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

Check float types "inf", "-inf" and "nan"

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.12
    • 1.1.13
    • DBAPI 2.0
    • None
    • 3.13

    Description

      Check float parameter before executing and raise an exception if it is "nan", "inf" or "-inf".

       
      {code:python}
      Python 3.13.0 (main, Feb 18 2025, 11:12:15) [GCC 13.3.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import mariadb
      >>> conn=mariadb.connect()
      >>> cursor=conn.cursor()
      >>> a=float("inf")
      >>> cursor.execute("select ?", (a,))
       
      Traceback (most recent call last):
        File "<python-input-4>", line 1, in <module>
          cursor.execute("select ?", (a,))
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
        File "/home/georg/work/venv13/lib/python3.13/site-packages/mariadb/cursors.py", line 321, in execute
          self._readresponse()
          ~~~~~~~~~~~~~~~~~~^^
      mariadb.ProgrammingError: Unknown column 'inf' in 'field list'
      {code}
      
      

      Diagnostic debug output for the SQL statement which was sent to the server:

      b'select inf'
      

      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.