Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5422

default values not supported in prepared statements

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 10.1
    • Component/s: None
    • Labels:
      None

      Description

      Default values are not supported by prepared statements. This slows down batch operations since you need to retrieve the default value for a column from information_schema:

        mysqll> CREATE TABLE t1 (a int  default 2);
      
        mysql_stmt_prepare(stmt, "INSERT INTO t1 VALUES (?)");
      
        for (i=0; i < numRows; i++)
        {
          if (RowPtr[i] == SQL_COLUMN_IGNORE)
          {
            /* since there is no MYSQL_TYPE_DEFAULT we need to retrieve
               the default value from information_schema. What a pain! */
          } else
          {
            bind[0].buffer_type= MYSQL_TYPE_LONG;
            bind{0].buffer= &RowValues[i];
          }
          mysql_stmt_execute(stmt);
        }
      

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                georg Georg Richter
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 week
                  1w
                  Remaining:
                  Remaining Estimate - 1 week
                  1w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified