<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="986739">
  <date_last_updated>2012-04-22 01:10:52.282850+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/986739</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~elenst</bug_owner_link>
    <milestone_link>https://api.launchpad.net/1.0/maria/+milestone/5.1</milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/986739/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/986739/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/986739</bug_web_link>
  <owner>Elena Stepanova</owner>
  <assignee>Sergey Petrunia</assignee>
  <milestone_title>Maria 5.1</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>sql-bench/test-table-elimination fails with SQL syntax error on OPTIMIZE if executed with --fast</title>
  <status>New</status>
  <importance>Low</importance>
  <created>2012-04-22 01:10:52.282850+00:00</created>
  <description>
<![CDATA[Got error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(0x1a19340)' at line 1 when executing 'OPTIMIZE TABLE'

Offending query as it's written into the general log:

OPTIMIZE TABLE ARRAY(0x1a19340)


If sql-bench/test-table-elimination is executed with --fast option (and assuming that bug #986731 is fixed), it calls 'vacuum' subroutine which, in turn, attempts to run OPTIMIZE TABLE. The 'vacuum' subroutine expects that the tables for OPTIMIZE are provided as an array, but test-table-elimination calls it with a reference to an array. The following change seems to fix the problem:


@@ -199,12 +199,12 @@
 
 if ($opt_fast && defined($server->{vacuum}))
 {
-  $server->vacuum(0,\$dbh,["elim_facts", "elim_attr1", "elim_attr2"]);
+  $server->vacuum(0,\$dbh,("elim_facts", "elim_attr1", "elim_attr2"));
 }

Reproducible on maria-5.1

bzr version-info
revision-id: <email address hidden>
date: 2012-04-06 13:31:33 +0500
build-date: 2012-04-22 05:08:00 +0400
revno: 3146

Same code in other versions.

To reproduce,
- start MariaDB server;
- run test-table-elimination --socket=<socket> --fast
(if it fails with a syntax error in LOCK TABLES, fix bug #986731 first).]]>  </description>
  <activities>
    <activity datechanged="2012-04-22T01:10:52.282850+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Elena Stepanova</person>
      <message>added bug</message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/986739/comments/0" datecreated="2012-04-22T01:10:52.282850+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[sql-bench/test-table-elimination fails with SQL syntax error on OPTIMIZE if executed with --fast]]>      </subject>
      <content>
<![CDATA[Got error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(0x1a19340)' at line 1 when executing 'OPTIMIZE TABLE'

Offending query as it's written into the general log:

OPTIMIZE TABLE ARRAY(0x1a19340)


If sql-bench/test-table-elimination is executed with --fast option (and assuming that bug #986731 is fixed), it calls 'vacuum' subroutine which, in turn, attempts to run OPTIMIZE TABLE. The 'vacuum' subroutine expects that the tables for OPTIMIZE are provided as an array, but test-table-elimination calls it with a reference to an array. The following change seems to fix the problem:


@@ -199,12 +199,12 @@
 
 if ($opt_fast && defined($server->{vacuum}))
 {
-  $server->vacuum(0,\$dbh,["elim_facts", "elim_attr1", "elim_attr2"]);
+  $server->vacuum(0,\$dbh,("elim_facts", "elim_attr1", "elim_attr2"));
 }

Reproducible on maria-5.1

bzr version-info
revision-id: holyfoot@askmonty.org-20120406083133-j6s0hqnkaimuct1r
date: 2012-04-06 13:31:33 +0500
build-date: 2012-04-22 05:08:00 +0400
revno: 3146

Same code in other versions.

To reproduce,
- start MariaDB server;
- run test-table-elimination --socket=<socket> --fast
(if it fails with a syntax error in LOCK TABLES, fix bug #986731 first).]]>      </content>
    </comment>
  </comments>
</launchpad-bug>
