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

Issue about the operator NOT LIKE on connect-engine

Details

    Description

      The "not like" operator don't work as expected, it don't return any data when it use trought the connect-engine while the "like" works well, and while on sql_server the exactly same sql query return data

      MariaDB [test]> create table ressource  (
       
          ARS_RESSOURCE varchar(10) NULL,
          ARS_TYPERESSOURCE varchar(10) NULL,
          ARS_LIBELLE  varchar(40) NULL,
          ARS_FERME varchar(10) NULL,
          ARS_LIBRERES1 varchar(10) NULL
       
         )
      ENGINE=CONNECT 
      table_type=ODBC
      DEFAULT CHARSET=latin1 
      CONNECTION='Driver=ODBC Driver 11 for SQL Server;Server=******;Database=******;UID=*******;PWD=******';
      

      so the table is on an remote server so when i try

      MariaDB [test]> SELECT ARS_RESSOURCE, ARS_LIBELLE FROM ressource WHERE ARS_RESSOURCE  LIKE "00%"; 
       ARS_RESSOURCE look like '00120', '00230' and the result  throught mariadb of the LIKE operator works well
       
      ||ARS_RESSOURCE||ARS_LIBELLE||
      |00120|foo|
      |00230|bar|
      

      but when i tried even a whatever query with NOT LIKE operator

      MariaDB [test]> SELECT ARS_RESSOURCE, ARS_LIBELLE FROM ressource WHERE ARS_RESSOURCE NOT LIKE "azeraze%"; 
      

      I don't have any result while this query works well directly on the sqlserver

      if you need any more informations, feel free to ask them

      Attachments

        Issue Links

          Activity

            Perhaps adding a virtual function isNegated() in Item_func so no casting would be required.

            bertrandop Olivier Bertrand added a comment - Perhaps adding a virtual function isNegated() in Item_func so no casting would be required.

            negated was made public in MDEV-17508

            Now CONNECT can use it to generate the correct condition for pushing.

            serg Sergei Golubchik added a comment - negated was made public in MDEV-17508 Now CONNECT can use it to generate the correct condition for pushing.
            bertrandop Olivier Bertrand added a comment - - edited

            I just pulled the last 10.2.29 and 10.3.20 versions but could not fix this bug because negated is still private in Item_func_like and no get_negated() function exists in it.

            Temporarily, a (bad) fix was to comment out the LIKE case and return to what was done in older versions. LIKE queries are not filtered in ODBC (the all result set is returned so performance can be reduced) but the query is successfully filtered by MariaDB WHERE clause so the good result is obtained.

            bertrandop Olivier Bertrand added a comment - - edited I just pulled the last 10.2.29 and 10.3.20 versions but could not fix this bug because negated is still private in Item_func_like and no get_negated() function exists in it. Temporarily, a (bad) fix was to comment out the LIKE case and return to what was done in older versions. LIKE queries are not filtered in ODBC (the all result set is returned so performance can be reduced) but the query is successfully filtered by MariaDB WHERE clause so the good result is obtained.

            Sorry, pushed into 10.2 now. Commit 3551cd32a8df.

            serg Sergei Golubchik added a comment - Sorry, pushed into 10.2 now. Commit 3551cd32a8df.

            A true fix this time.

            bertrandop Olivier Bertrand added a comment - A true fix this time.

            People

              bertrandop Olivier Bertrand
              MacBooc Martin Francois
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.