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

mariadb.DataError (1265) is not raised

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 1.0.11
    • N/A
    • DBAPI 2.0
    • None
    • CentOS 7 w/ python 3.9.5 w/ Connector/C 3.2.3 w/ Connector/python 1.0.11
    • python 3.9.5

    Description

      Here is the repro:

      delimiter //

      drop function if exists func5073//
      CREATE FUNCTION func5073(arg ENUM('a', 'b')) RETURNS ENUM('c', 'd') DETERMINISTIC
      BEGIN
      RETURN arg;
      END//

      delimiter ;
      SELECT func5073(1);

      This is what happens on the MariaDB client

      MariaDB [test]> SELECT func5073(1);
      ERROR 1265 (01000): Data truncated for column 'func5073(1)' at row 1
      MariaDB [test]> SELECT version();
      +----------------+
      | version()      |
      +----------------+
      | 10.6.9-MariaDB |
      +----------------+
      

      We get an error about our silly stored function.

      Here is what the python connector does:

      import mariadb
      import mariadb.constants.CLIENT as CLIENT
       
      dut_cfg = {"host": "vqc004a", "port": 60190,
                  "user": "root", "passwd": "",
                  "db": "test", "autocommit": True,
                  "connect_timeout": 60,
                  "client_flag": CLIENT.MULTI_STATEMENTS}
       
      conn = mariadb.connect(**dut_cfg)
      dut_cur = conn.cursor()
       
      sql0="SELECT func5073(1)"
       
      for cursor in (dut_cur, ):
          cursor.execute(sql0)
          print(cursor.fetchall())
      

      Let's run this.

      [root@vqc004a 5073]# python foo.py
      []
      [root@vqc004a 5073]#
      

      There isn't any exception that is raised. I expected a mariadb.DataError exception to be raised.

      Attachments

        Activity

          People

            georg Georg Richter
            bchin Brad Chin (Inactive)
            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.