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

§ character generate incorrect output when used as function parameter string

    XMLWordPrintable

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

        1. DSN configuration.png
          40 kB
          Francesco Salvini

        Activity

          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.