Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-436

§ character generate incorrect output when used as function parameter string

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 3.2.2
    • N/A
    • General
    • None
    • MS Access 2003 on Windows 10/11

    Description

      I know, MS Access 2003 is quiet old but...

      I have a stored function in my mariadb 11.4.2 server like this:

      CREATE DEFINER=`root`@`%` FUNCTION `separator_test`(var_in_separatore VARCHAR(3)) RETURNS varchar(255) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci
          DETERMINISTIC
      BEGIN
       
       RETURN concat('hello', var_in_separatore, 'world');
       
      END
      

      If I call this function using the ODBC connector in this way

      Public Sub test()
       
          Dim cn As ADODB.Connection
          Dim rst As ADODB.Recordset
          
          Set cn = mariadbConnection
          Set rst = dammirecordset_ADO(cn, "SELECT separator_test('§');")
          
          Debug.Print "output: " & rst(0)
          
      End Sub
      

      mariadbConnection creates an ADODB.Connection object.
      dammirecordset_ADO creates an ADODB.Recordset object using the query specified as parameter.

      Why the output string I receive has a space at the end of the string?
      Also, if I specify a 2§ as parameter the output string has 2 empty chars at the end of the string and so on.

      Please note that if I trim the output string the output is always the same.
      In addition, if I execute

      SELECT TRIM(separator_test('§'));
      

      the result is again the same.

      I solved changing the character used as separator (using # the output string is correct) but I think there's no good reason to not use the § character, isn't it?

      PS: I tried other characteres and £ character produce the same problem.

      Thank you so much for your help and your effort.

      Francesco

      Attachments

        Activity

          Thank you for your additional information. Well, I will have to find out why is it different for MariaDB connector

          Lawrin Lawrin Novitsky added a comment - Thank you for your additional information. Well, I will have to find out why is it different for MariaDB connector

          It looks like the same issue like in ODBC-437. If I attach here driver library with the fix for ODBC-437, will it be possible for you to test if it also fixes your issue?

          Lawrin Lawrin Novitsky added a comment - It looks like the same issue like in ODBC-437 . If I attach here driver library with the fix for ODBC-437 , will it be possible for you to test if it also fixes your issue?

          Sure! 🙂

          piozzo Francesco Salvini added a comment - Sure! 🙂

          I assume you need 32bit library for your Access. If it's still 64b - please let me know

          Lawrin Lawrin Novitsky added a comment - I assume you need 32bit library for your Access. If it's still 64b - please let me know
          Lawrin Lawrin Novitsky added a comment - - edited

          I think I've verified that it fixes your problem and I didn't really have doubts

          Lawrin Lawrin Novitsky added a comment - - edited I think I've verified that it fixes your problem and I didn't really have doubts

          People

            Lawrin Lawrin Novitsky
            piozzo Francesco Salvini
            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.