Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-134

Using column named 'Element' causing unknown MySQL error

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 1.0.4
    • Fix Version/s: N/A
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Environment:
      Ubuntu 18.04, Mariadb 10.5.8

      Description

      used Table def:

      CREATE TABLE `data` (
      `Element` varchar(12) NOT NULL,
      `Data` varchar(48) NOT NULL,
      `Status` tinyint(1) unsigned DEFAULT 1,
      `EmailAddress` varchar(96) DEFAULT NULL,
      `Destination` varchar(12) DEFAULT NULL,
      KEY `Element` (`Element`,`Data`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

      cnx = mariadb.connect(**dbconfig)
      cnx.autocommit = True
      csr = cnx.cursor(dictionary=True, buffered=True)

      csr.execute("select * from `data` where `Status`=1") is ok

      csr.execute("select `Element`,`Data`,`EmailAddress`,`Destination` from `data` where `Status`=1") causes unknown MySQL error

      csr.execute("select `Data`,`EmailAddress`,`Destination` from `data` where `Status`=1") is ok

      So it seems that select `Element` .... causes the error.

      When using select * from .... the column `Element` is returned correctly.

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            vincent.lemoine@iwa-consult.nl V H Lemoine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration