Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-697

Truncated incorrect DOUBLE value: 'C:\Users\matti\Downloads\jfk.wav'

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.3.8
    • N/A
    • Prepared Statements
    • None
    • Windows 10 Pro

    Description

      MariaDB fails to handle bound Windows path string correctly in UPDATE statement execution and returns the following error.

      Truncated incorrect DOUBLE value: 'C:\Users\matti\Downloads\jfk.wav'

      Server version: 10.11.8-MariaDB mariadb.org binary distribution

           // return results to user
           std::string results = output_str(ctx, pcmf32s);
       
           MYSQL_STMT* gUpdateStmt = mysql_stmt_init(&mysql);
           if (gUpdateStmt == NULL) {
               WriteToLog("Init stmt failed");
               continue;
           }
       
           std::cout << "Initialized statement\n";
       
           char statement[] = "UPDATE voicelog SET transcription = ? WHERE filename = ?";
           int result = mysql_stmt_prepare(gUpdateStmt, statement, strlen(statement));  
           if (result != 0) {
               WriteToLog("prepare stmt failed");
               continue;
           }
       
           std::cout << "Prepared statement\n";
       
           /* Get the parameter count from the statement */
           int param_count = mysql_stmt_param_count(gUpdateStmt);
           std::cout << "Total parameters in UPDATE: " << param_count << "\n";
       
           MYSQL_BIND bind[2];
       
           memset(bind, 0, sizeof(bind));
       
           bind[0].buffer_type = MYSQL_TYPE_STRING;
           bind[0].buffer = &results;
           bind[0].is_null = 0;
           unsigned long resultLength = results.length();
           bind[0].length = &resultLength;
           bind[0].buffer_length = resultLength + 1;
           bind[1].buffer_type = MYSQL_TYPE_STRING;
           bind[1].buffer = &filename;
           bind[1].is_null = 0;
           unsigned long filenameLength = filename.length();
           bind[1].length = &filenameLength;
           bind[1].buffer_length = filenameLength + 1;
       
           result = mysql_stmt_bind_param(gUpdateStmt, bind);
           if (result != 0) {
               WriteToLog("bind stmt bind failed");
               continue;
           }
           
           std::cout << "Bound '" << results << "', '" << filename << "'\n";
       
           result = mysql_stmt_execute(gUpdateStmt); 
           if (result != 0) {
               WriteToLog("execute stmt update failed");
               std::cerr << mysql_stmt_error(gUpdateStmt) << "\n";
               continue;
           }
      

      Attachments

        Activity

          People

            georg Georg Richter
            mattilinnanvuori Matti Linnanvuori
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.