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

Spider: IF(COUNT( trigger SQL Error (1054)_ Unknown column '' in field list

Details

    Description

      Hio,

      works with 10.4.13, somewhere between 10.4.14 and 10.4.17 broken.

      Testcase to reproduce

       
      USE spider;
       
      DROP TABLE if EXISTS `t1`;
      DROP TABLE if EXISTS `t1remote`;
       
      CREATE TABLE `t1` (
      	id INT)
      	;
      CREATE TABLE `t1remote` (
      	id INT)
       ENGINE=SPIDER DEFAULT CHARSET=utf8 COMMENT='host "127.0.0.1",  database "spider" ,table "t1" ,user "spider", password "xxxxxxx", port "3307"';
      	
      SELECT IF(COUNT(a.`id` )>=0,'Y','N') FROM t1remote a;
      

      Attachments

        Issue Links

          Activity

            Another possible way to fix the bug would be to change the timing when the SQL for a data node is generated. I will try to see whether this works.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - - edited Another possible way to fix the bug would be to change the timing when the SQL for a data node is generated. I will try to see whether this works.
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - - edited holyfoot please review: https://github.com/MariaDB/server/commit/e7b573637206a89722da7f72cbaaf76cbb63a634

            holyfoot I may have come up with another way to fix it. If the server properly set Item::name even to Item_ref, Spider can easily print it. Let me withdraw the patch.

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - holyfoot I may have come up with another way to fix it. If the server properly set Item::name even to Item_ref , Spider can easily print it. Let me withdraw the patch.

            holyfoot The above idea didn't work. That is because the Item class has a recursive structure and Item::name seems to be given only to the outermost Item.

            So, please review the original patch: https://github.com/MariaDB/server/commit/e7b573637206a89722da7f72cbaaf76cbb63a634

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - holyfoot The above idea didn't work. That is because the Item class has a recursive structure and Item::name seems to be given only to the outermost Item. So, please review the original patch: https://github.com/MariaDB/server/commit/e7b573637206a89722da7f72cbaaf76cbb63a634

            ok to push

            holyfoot Alexey Botchkov added a comment - ok to push

            People

              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              Richard Richard Stracke
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.