mariadb/mysql-test/suite
Aleksey Midenkov a3c379ea61 MDEV-23799 CREATE .. SELECT wrong result on join versioned table
For join to work correctly versioning condition must be added to table
on_expr. Without that JOIN_CACHE gets expression (1)

  trigcond(xtitle.row_end = TIMESTAMP'2038-01-19 06:14:07.999999') and
  trigcond(xtitle.elementId = x.`id` and xtitle.pkey = 'title')

instead of (2)

  trigcond(xtitle.elementId = x.`id` and xtitle.pkey = 'title')

for join_null_complements(). It is NULL-row of xtitle for
complementing the join and the above comparisons of course FALSE, but
trigcond (Item_func_trig_cond) makes them TRUE via its trig_var
property which is bound to some boolean properties of JOIN_TAB.

Expression (2) evaluated to TRUE because its trig_var is bound to
first_inner_tab->not_null_compl. The expression (1) does not evaluate
correctly because row_end comparison's trig_var is bound to
first_inner->found earlier. As a result JOIN_CACHE::check_match()
skipped the row for join_null_complements().

When we add versioning condition to table's on_expr the optimizer in
make_join_select() distributes conditions differently. tmp_cond
inherits on_expr value and in Good case it is full expression

xgender.elementId = x.`id` and xgender.pkey = 'gender' and
xgender.row_end = TIMESTAMP'2038-01-19 06:14:07.999999'

while in Bad case it is only

xgender.elementId = x.`id` and xgender.pkey = 'gender'.

Later in Good row_end condition is optimized out and we get one
trigcond in form of (2).
2020-10-20 10:49:54 +03:00
..
archive
binlog Merge branch '10.2' into 10.3 2020-09-28 17:27:42 +05:30
binlog_encryption MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose 2020-08-31 18:45:14 +03:00
compat
csv
encryption Merge 10.2 into 10.3 2020-09-22 14:33:03 +03:00
engines
federated
funcs_1
funcs_2
galera Merge 10.2 into 10.3 2020-09-21 11:04:04 +03:00
galera_3nodes MDEV-23659 : Update Galera disabled.def file 2020-09-28 14:40:00 +03:00
gcol Merge 10.2 into 10.3 2020-09-21 11:04:04 +03:00
handler
heap
innodb Merge 10.2 into 10.3 2020-09-30 16:25:06 +03:00
innodb_fts
innodb_gis
innodb_zip
jp
json
large_tests
maria
mariabackup Merge 10.2 into 10.3 2020-09-21 16:39:23 +03:00
mtr/t
mtr2
multi_source
optimizer_unfixed_bugs
parts MDEV-23248 Server crashes in mi_extra / ha_partition::loop_extra_alter upon REORGANIZE 2020-10-16 19:48:36 +03:00
perfschema
perfschema_stress
plugins
roles
rpl Merge 10.2 into 10.3 2020-09-22 21:12:48 +03:00
sql_sequence MDEV-23823 Crash in SELECT NEXT VALUE on locked view 2020-09-28 09:49:46 +02:00
storage_engine
stress
sys_vars Revert "[MDEV-7978] add show create user" 2020-09-24 13:58:29 +10:00
unit
vcol Merge 10.2 into 10.3 2020-09-03 09:26:54 +03:00
versioning MDEV-23799 CREATE .. SELECT wrong result on join versioned table 2020-10-20 10:49:54 +03:00
wsrep