Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-652

Derived tables in a join subquery cause error

Details

    • 2017-6, 2017-7

    Description

      When using a join with a derived table you get the error:

      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 'USE INDEX () join (select 1 AS `dummy`,count(test.vehicle.id) AS `total_vehicles' at line 1

      We add USE INDEX() as part of MCOL-424 but we only need to do this for real tables, not derived.

      Attachments

        Activity

          LinuxJedi Andrew Hutchings (Inactive) created issue -
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Field Original Value New Value
          Issue Type New Feature [ 2 ] Bug [ 1 ]

          Pull request open for 1.0 and develop server trees

          LinuxJedi Andrew Hutchings (Inactive) added a comment - Pull request open for 1.0 and develop server trees
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Assignee Andrew Hutchings [ linuxjedi ] David Hall [ david.hall ]
          Status Open [ 1 ] In Review [ 10002 ]
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Fix Version/s 1.0.9 [ 22526 ]
          Fix Version/s 1.1.0 [ 22100 ]
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Sprint 2017-6 [ 145 ]
          David.Hall David Hall (Inactive) made changes -
          Status In Review [ 10002 ] In Testing [ 10301 ]
          David.Hall David Hall (Inactive) made changes -
          Assignee David Hall [ david.hall ] Daniel Lee [ dleeyh ]
          dthompson David Thompson (Inactive) made changes -
          Sprint 2017-6 [ 145 ] 2017-6, 2017-7 [ 145, 152 ]

          Build tested: 1.0.9-1 (branch develop-1.0)
          [root@localhost mariadb-columnstore-server]# git show
          commit 8ef673b333f79586645321a60e1ee3c1bcfc491c
          Merge: e688674 7e877fa
          Author: dhall-InfiniDB <david.hall@mariadb.com>
          Date: Mon Apr 3 09:51:52 2017 -0500
          Merge pull request #39 from mariadb-corporation/MCOL-652-1.0
          MCOL-652 Fix certain derived table cases
          [root@localhost mariadb-columnstore-engine]# git show
          commit 1c2e9bd8281c5ad717820b7ec0bc234c47321b22
          Merge: 310f8e5 b60c45a
          Author: dhall-InfiniDB <david.hall@mariadb.com>
          Date: Mon Apr 3 09:47:57 2017 -0500
          Merge pull request #144 from mariadb-corporation/MCOL-653-1.0
          MCOL-653 Revert SUM(1) behaviour

          Reproduced the issue in 1.0.8-1 (1um2pm stack) with just one procedure call
          MariaDB [(none)]> use automated_reports;
          Database changed
          MariaDB [automated_reports]> call DRUG_vehicles_in_crashes( 5 );
          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 'USE INDEX () join (select 1 AS `dummy`,count(automated_reports.vehicle.id) AS `t' at line 1

          Verified 1.0.9-1. Called 10 times without causing the error.

          dleeyh Daniel Lee (Inactive) added a comment - Build tested: 1.0.9-1 (branch develop-1.0) [root@localhost mariadb-columnstore-server] # git show commit 8ef673b333f79586645321a60e1ee3c1bcfc491c Merge: e688674 7e877fa Author: dhall-InfiniDB <david.hall@mariadb.com> Date: Mon Apr 3 09:51:52 2017 -0500 Merge pull request #39 from mariadb-corporation/ MCOL-652 -1.0 MCOL-652 Fix certain derived table cases [root@localhost mariadb-columnstore-engine] # git show commit 1c2e9bd8281c5ad717820b7ec0bc234c47321b22 Merge: 310f8e5 b60c45a Author: dhall-InfiniDB <david.hall@mariadb.com> Date: Mon Apr 3 09:47:57 2017 -0500 Merge pull request #144 from mariadb-corporation/ MCOL-653 -1.0 MCOL-653 Revert SUM(1) behaviour Reproduced the issue in 1.0.8-1 (1um2pm stack) with just one procedure call MariaDB [(none)] > use automated_reports; Database changed MariaDB [automated_reports] > call DRUG_vehicles_in_crashes( 5 ); 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 'USE INDEX () join (select 1 AS `dummy`,count(automated_reports.vehicle.id) AS `t' at line 1 Verified 1.0.9-1. Called 10 times without causing the error.

          Build verified: 1.1.0-1 (GitHub develop branch)
          Author: dhall-InfiniDB <david.hall@mariadb.com>
          Date: Mon Apr 3 09:52:07 2017 -0500
          Merge pull request #38 from mariadb-corporation/MCOL-652
          MCOL-652 Fix certain derived table cases
          [root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/
          [root@localhost mariadb-columnstore-engine]# git show
          commit 3e85b6ef07ffcfb4edc84e170efcccdb9cd15cc2
          Merge: 04bdb60 8baf059
          Author: dhall-InfiniDB <david.hall@mariadb.com>
          Date: Mon Apr 3 09:48:55 2017 -0500
          Merge pull request #143 from mariadb-corporation/MCOL-653
          MCOL-653 Revert SUM(1) behaviour
          Welcome to the MariaDB monitor. Commands end with ; or \g.
          Your MariaDB connection id is 22
          Server version: 10.1.21-MariaDB Columnstore 1.1.0-1

          Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

          Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

          Did the same test as for 1.0.9-1

          dleeyh Daniel Lee (Inactive) added a comment - Build verified: 1.1.0-1 (GitHub develop branch) Author: dhall-InfiniDB <david.hall@mariadb.com> Date: Mon Apr 3 09:52:07 2017 -0500 Merge pull request #38 from mariadb-corporation/ MCOL-652 MCOL-652 Fix certain derived table cases [root@localhost mariadb-columnstore-server] # cd mariadb-columnstore-engine/ [root@localhost mariadb-columnstore-engine] # git show commit 3e85b6ef07ffcfb4edc84e170efcccdb9cd15cc2 Merge: 04bdb60 8baf059 Author: dhall-InfiniDB <david.hall@mariadb.com> Date: Mon Apr 3 09:48:55 2017 -0500 Merge pull request #143 from mariadb-corporation/ MCOL-653 MCOL-653 Revert SUM(1) behaviour Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.1.21-MariaDB Columnstore 1.1.0-1 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Did the same test as for 1.0.9-1
          dleeyh Daniel Lee (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status In Testing [ 10301 ] Closed [ 6 ]

          People

            dleeyh Daniel Lee (Inactive)
            LinuxJedi Andrew Hutchings (Inactive)
            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.