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

Prepared statement with parameters in new DEFAULT syntax fails with syntax error upon execution

    XMLWordPrintable

Details

    Description

      MariaDB [test]> set @a=1, @b=2;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> prepare stmt from "create or replace table t1 (i int default (?+?))";
      Query OK, 0 rows affected (0.00 sec)
      Statement prepared
       
      MariaDB [test]> execute stmt using @a,@b;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?+?)' at line 1
      

      I guess it's not a big deal not to have this functionality, but the error is confusing, especially since this works:

      MariaDB [test]> prepare stmt from "create or replace table t1 (i int default (?))";
      Query OK, 0 rows affected (0.00 sec)
      Statement prepared
       
      MariaDB [test]> execute stmt using @a;
      Query OK, 0 rows affected (0.65 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              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.