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

WHERE virtual column index substitution causes wrong results when truncation happens

    XMLWordPrintable

Details

    • Q3/2026 Server Maintenance

    Description

      This is the WHERE version of MDEV-38752. After MDEV-35616 (pushed to 11.8):

      CREATE TABLE t (a INT, va TINYINT AS (a), key (va));
      INSERT IGNORE INTO t (a) VALUES (100),(150),(200),(180);
      Warnings:
      Warning	1264	Out of range value for column 'va' at row 2
      Warning	1264	Out of range value for column 'va' at row 3
      Warning	1264	Out of range value for column 'va' at row 4
      explain
      select * from t where a = 127;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
      1	SIMPLE	t	ref	va	va	2	const	3	
      select * from t where a = 127;
      a	va
      150	127
      200	127
      180	127
      select * from t use index() where a = 127;
      a       va
      drop table t;
      

      The last SELECT should produce empty results.

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.