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

Using column named 'Element' causing unknown MySQL error

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 1.0.4
    • N/A
    • DBAPI 2.0
    • None
    • 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

            georg Georg Richter
            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

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.