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

unittest test_conpy175 fails with sql_mode="NO_BACKSLASH_ESCAPES"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.9
    • 1.1.10
    • Tests
    • None
    • 3.10

    Description

      test_conpy175 unittest fails, if tests are running against server with sql_mode=NO_BACKSLASH_ESCAPES.

      Proposal:

          def test_conpy175(self):
              default_conf = conf()
              c1 = mariadb.connect(**default_conf)
              str = "Bob's"
              newstr = c1.escape_string(str)
              if c1.server_status & STATUS.NO_BACKSLASH_ESCAPES:
                  self.assertEqual(newstr, "Bob''s")
              else:
                  self.assertEqual(newstr, "Bob\\'s")
              c1.close()
      

      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.