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

CAST AS binary doesn't return binary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1
    • Component/s: Generic
    • Labels:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: