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

LP:960587 - Bit Field Causing Issues with Inner Join

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Not a Bug
    • None
    • None
    • None

    Description

      SELECT `category`.`keyword` AS `category_keyword`, `string`.`keyword` AS `string_keyword`, `string`.`string` AS `string_string` FROM `application_i18n_category` AS `category` LEFT JOIN `application_i18n_string` AS `string` ON `category`.`id` = `string`.`category` AND `string`.`disabled` = 0 WHERE `category`.`id` IN ( 9757 );

      Query returns 1 result on mariaDB, same query returns 28 results on mysql 5.5

      Removing the AND `string`.`disabled` = 0 returns the same amount of results on both mysql and mariadb

      a count on both returns identical results.
      MySQL
      mysql> select count from application_i18n_string where disabled=0;
      ----------

      count

      ----------

      335895

      ----------

      MariaDB [sabretooth]> select count from application_i18n_string where disabled=0;
      ----------

      count

      ----------

      335233

      ----------

      show create table application_i18n_category;
      CREATE TABLE `application_i18n_category` (
      `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
      `appid` int(11) unsigned NOT NULL,
      `keyword` varchar(30) NOT NULL,
      `disabled` bit(1) NOT NULL DEFAULT b'0',
      PRIMARY KEY (`id`),
      KEY `appid` (`appid`,`disabled`,`keyword`)
      ) ENGINE=InnoDB AUTO_INCREMENT=12272 DEFAULT CHARSET=utf8

      show create table application_i18n_string;

      CREATE TABLE `application_i18n_string` (
      `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
      `category` int(11) unsigned NOT NULL,
      `keyword` varchar(30) NOT NULL,
      `language` varchar(2) NOT NULL,
      `string` text NOT NULL,
      `disabled` bit(1) NOT NULL DEFAULT b'0',
      PRIMARY KEY (`id`),
      KEY `category` (`category`,`keyword`,`language`,`disabled`)
      ) ENGINE=InnoDB AUTO_INCREMENT=934209 DEFAULT CHARSET=utf8

      Attachments

        Activity

          People

            Unassigned Unassigned
            davefm DaveFM (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.