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

CAST AS binary doesn't return binary

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1
    • Generic
    • None

    Description

      When casting to binary the fetched result will be a unicode string instead of a binary:

      Python 3.8.2rc2+ (heads/3.8-dirty:44c6901, Jul 28 2020, 18:31:20) 
      [GCC 8.3.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import mariadb
      >>> 
      >>> conn= mariadb.connect()
      >>> cursor=conn.cursor()
      >>> cursor.execute("SELECT CAST('foo' AS BINARY) AS anon_1 WHERE 1=?", (1,))
      >>> cursor.fetchone()
      ('foo',)
      >>> cursor.execute("SELECT CAST('foo' AS BINARY) AS anon_1")
      >>> cursor.fetchone()
      ('foo',)
      

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.