Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.8
    • Fix Version/s: 10.0.10
    • Component/s: None
    • Labels:

      Description

      The CONNECT engine is generating nonsense SQL for a PIVOT table I created:

      drop table if exists t1;
      CREATE TABLE `t1` (  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,  `name` varchar(32) DEFAULT NULL,  `cnt` int(11) DEFAULT NULL,  PRIMARY KEY (`id`) ) ENGINE=InnoDB;
      INSERT INTO `t1` VALUES (1,'apple',1),(2,'banana',1),(3,'apple',2),(4,'cherry',4),(5,'durazno',2);
      drop table if exists fruit_pivot;
      CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=t1;
      select * from fruit_pivot;
      
      ERROR 1296 (HY000): Got error 174 '(1064) 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 'id, nameSELECT , SUM(cnt) cnt FROM t1 GROUP BY' at line ' from CONNECT
      

      From the general query log:

                         10 Query     SELECT id, nameSELECT , SUM(cnt) cnt FROM t1 GROUP BY id, nameSELECT id, nameSELECT , SUM(cnt) cnt FROM t1 GROUP BY
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            kolbe Kolbe Kegel added a comment -

            Is this still not merged into main MariaDB 10.0.10? Is there a merge schedule for CONNECT fixes? I'm worried this isn't going to make it into 10.0.0 at this point...

            Show
            kolbe Kolbe Kegel added a comment - Is this still not merged into main MariaDB 10.0.10? Is there a merge schedule for CONNECT fixes? I'm worried this isn't going to make it into 10.0.0 at this point...
            Hide
            kolbe Kolbe Kegel added a comment -

            Also, the workaround of using a table name other than "t1" does not seem to work...

            mysql 10.0.9-MariaDB (root) [test] db1> CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit_table;
            Query OK, 0 rows affected (0.04 sec)

            mysql 10.0.9-MariaDB (root) [test] db1> select * from fruit_pivot;
            140324 23:10:45 mysqld_safe Number of processes running now: 0
            140324 23:10:45 mysqld_safe mysqld restarted
            ERROR 2013 (HY000): Lost connection to MySQL server during query

            Show
            kolbe Kolbe Kegel added a comment - Also, the workaround of using a table name other than "t1" does not seem to work... mysql 10.0.9-MariaDB (root) [test] db1> CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit_table; Query OK, 0 rows affected (0.04 sec) mysql 10.0.9-MariaDB (root) [test] db1> select * from fruit_pivot; 140324 23:10:45 mysqld_safe Number of processes running now: 0 140324 23:10:45 mysqld_safe mysqld restarted ERROR 2013 (HY000): Lost connection to MySQL server during query
            Hide
            kolbe Kolbe Kegel added a comment -

            On OS X, built from revno 4081:

            mysql 10.0.10-MariaDB (root) [test]> alter table fruity_fruits rename fruit_table;
            Query OK, 0 rows affected (0.01 sec)

            mysql 10.0.10-MariaDB (root) [test]> CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit_table;
            Query OK, 0 rows affected (0.01 sec)

            mysql 10.0.10-MariaDB (root) [test]> select * from fruit_pivot;
            ERROR 1296 (HY000): Got error 174 '(1064) 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 'id, nameSELECT , SUM(cnt) cnt FROM fruit_table GROUP BY'' from CONNECT

            Show
            kolbe Kolbe Kegel added a comment - On OS X, built from revno 4081: mysql 10.0.10-MariaDB (root) [test] > alter table fruity_fruits rename fruit_table; Query OK, 0 rows affected (0.01 sec) mysql 10.0.10-MariaDB (root) [test] > CREATE TABLE fruit_pivot ENGINE=CONNECT TABLE_TYPE=pivot TABNAME=fruit_table; Query OK, 0 rows affected (0.01 sec) mysql 10.0.10-MariaDB (root) [test] > select * from fruit_pivot; ERROR 1296 (HY000): Got error 174 '(1064) 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 'id, nameSELECT , SUM(cnt) cnt FROM fruit_table GROUP BY'' from CONNECT
            Hide
            elenst Elena Stepanova added a comment -

            Is this still not merged into main MariaDB 10.0.10? Is there a merge schedule for CONNECT fixes? I'm worried this isn't going to make it into 10.0.0 at this point...

            Here is the merge task: https://mariadb.atlassian.net/browse/MDEV-5937
            It is a blocker, so, it should make it to the release all right.

            Meanwhile, if you want, you could try 10.0-connect tree.

            Show
            elenst Elena Stepanova added a comment - Is this still not merged into main MariaDB 10.0.10? Is there a merge schedule for CONNECT fixes? I'm worried this isn't going to make it into 10.0.0 at this point... Here is the merge task: https://mariadb.atlassian.net/browse/MDEV-5937 It is a blocker, so, it should make it to the release all right. Meanwhile, if you want, you could try 10.0-connect tree.
            Hide
            bertrandop Olivier Bertrand added a comment -

            Bypass: sorry about that, in fact it does not work. But changing the length of one of the column names possibly works!

            Show
            bertrandop Olivier Bertrand added a comment - Bypass: sorry about that, in fact it does not work. But changing the length of one of the column names possibly works!

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                kolbe Kolbe Kegel
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h