📄 ndb_condition_pushdown.test
字号:
(-1 not in(long_int)) and(-1 not in(longlong)) and1 not in(utiny) and 1 not in(ushort) and 1 not in(umedium) and 1 not in(ulong) and 1 not in(ulonglong) and b'001' not in(bits) and'one' not in(options) and 'one' not in(flags) and '1901-01-01' not in(date_field) and'1901' not in(year_field) and'01:01:01' not in(time_field) and '1901-01-01 01:01:01' not in(date_time) order by auto;# Various tests select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;select * from t2 where attr3 is not null and attr1 > 2 order by pk1;select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;set engine_condition_pushdown = on;# Test all types and compare operatorsexplainselect auto from t1 where string = "aaaa" and vstring = "aaaa" and bin = 0xAAAA and vbin = 0xAAAA andtiny = -1 and short = -1 and medium = -1 and long_int = -1 and longlong = -1 and real_float > 1.0 and real_float < 2.0 and real_double > 1.0 and real_double < 2.0 andreal_decimal > 1.0 and real_decimal < 2.0 andutiny = 1 and ushort = 1 and umedium = 1 and ulong = 1 and ulonglong = 1 and /* bits = b'001' and */options = 'one' and flags = 'one' and date_field = '1901-01-01' andyear_field = '1901' andtime_field = '01:01:01' and date_time = '1901-01-01 01:01:01' order by auto;select auto from t1 where string = "aaaa" and vstring = "aaaa" and bin = 0xAAAA and vbin = 0xAAAA andtiny = -1 and short = -1 and medium = -1 and long_int = -1 and longlong = -1 and real_float > 1.0 and real_float < 2.0 and real_double > 1.0 and real_double < 2.0 andreal_decimal > 1.0 and real_decimal < 2.0 andutiny = 1 and ushort = 1 and umedium = 1 and ulong = 1 and ulonglong = 1 and /* bits = b'001' and */options = 'one' and flags = 'one' and date_field = '1901-01-01' andyear_field = '1901' andtime_field = '01:01:01' and date_time = '1901-01-01 01:01:01' order by auto;explainselect auto from t1 where string != "aaaa" and vstring != "aaaa" and bin != 0xAAAA and vbin != 0xAAAA andtiny != -1 and short != -1 and medium != -1 and long_int != -1 and longlong != -1 and (real_float < 1.0 or real_float > 2.0) and (real_double < 1.0 or real_double > 2.0) and(real_decimal < 1.0 or real_decimal > 2.0) andutiny != 1 and ushort != 1 and umedium != 1 and ulong != 1 and ulonglong != 1 and /* bits != b'001' and */options != 'one' and flags != 'one' and date_field != '1901-01-01' andyear_field != '1901' andtime_field != '01:01:01' and date_time != '1901-01-01 01:01:01' order by auto;select auto from t1 where string != "aaaa" and vstring != "aaaa" and bin != 0xAAAA and vbin != 0xAAAA andtiny != -1 and short != -1 and medium != -1 and long_int != -1 and longlong != -1 and (real_float < 1.0 or real_float > 2.0) and (real_double < 1.0 or real_double > 2.0) and(real_decimal < 1.0 or real_decimal > 2.0) andutiny != 1 and ushort != 1 and umedium != 1 and ulong != 1 and ulonglong != 1 and /* bits != b'001' and */options != 'one' and flags != 'one' and date_field != '1901-01-01' andyear_field != '1901' andtime_field != '01:01:01' and date_time != '1901-01-01 01:01:01' order by auto;explainselect auto from t1 where string > "aaaa" and vstring > "aaaa" and bin > 0xAAAA and vbin > 0xAAAA andtiny < -1 and short < -1 and medium < -1 and long_int < -1 and longlong < -1 and real_float > 1.1 and real_double > 1.1 and real_decimal > 1.1 and utiny > 1 and ushort > 1 and umedium > 1 and ulong > 1 and ulonglong > 1 and/* bits > b'001' and */(options = 'two' or options = 'three' or options = 'four') and(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field > '1901-01-01' andyear_field > '1901' andtime_field > '01:01:01' anddate_time > '1901-01-01 01:01:01'order by auto;select auto from t1 where string > "aaaa" and vstring > "aaaa" and bin > 0xAAAA and vbin > 0xAAAA andtiny < -1 and short < -1 and medium < -1 and long_int < -1 and longlong < -1 and real_float > 1.1 and real_double > 1.1 and real_decimal > 1.1 and utiny > 1 and ushort > 1 and umedium > 1 and ulong > 1 and ulonglong > 1 and/* bits > b'001' and */(options = 'two' or options = 'three' or options = 'four') and(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field > '1901-01-01' andyear_field > '1901' andtime_field > '01:01:01' anddate_time > '1901-01-01 01:01:01'order by auto;explainselect auto from t1 where string >= "aaaa" and vstring >= "aaaa" and bin >= 0xAAAA and vbin >= 0xAAAA andtiny <= -1 and short <= -1 and medium <= -1 and long_int <= -1 and longlong <= -1 and real_float >= 1.0 and real_double >= 1.0 and real_decimal >= 1.0 and utiny >= 1 and ushort >= 1 and umedium >= 1 and ulong >= 1 and ulonglong >= 1 and /* bits >= b'001' and */(options = 'one' or options = 'two' or options = 'three' or options = 'four') and(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field >= '1901-01-01' andyear_field >= '1901' andtime_field >= '01:01:01' and date_time >= '1901-01-01 01:01:01' order by auto;select auto from t1 where string >= "aaaa" and vstring >= "aaaa" and bin >= 0xAAAA and vbin >= 0xAAAA andtiny <= -1 and short <= -1 and medium <= -1 and long_int <= -1 and longlong <= -1 and real_float >= 1.0 and real_double >= 1.0 and real_decimal >= 1.0 and utiny >= 1 and ushort >= 1 and umedium >= 1 and ulong >= 1 and ulonglong >= 1 and /* bits >= b'001' and */(options = 'one' or options = 'two' or options = 'three' or options = 'four') and(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field >= '1901-01-01' andyear_field >= '1901' andtime_field >= '01:01:01' and date_time >= '1901-01-01 01:01:01' order by auto;explainselect auto from t1 where string < "dddd" and vstring < "dddd" and bin < 0xDDDD and vbin < 0xDDDD andtiny > -4 and short > -4 and medium > -4 and long_int > -4 and longlong > -4 and real_float < 4.4 and real_double < 4.4 andreal_decimal < 4.4 andutiny < 4 and ushort < 4 and umedium < 4 and ulong < 4 and ulonglong < 4 and /* bits < b'100' and */(options = 'one' or options = 'two' or options = 'three') and(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') anddate_field < '1904-01-01' andyear_field < '1904' andtime_field < '04:04:04' and date_time < '1904-04-04 04:04:04' order by auto;select auto from t1 where string < "dddd" and vstring < "dddd" and bin < 0xDDDD and vbin < 0xDDDD andtiny > -4 and short > -4 and medium > -4 and long_int > -4 and longlong > -4 and real_float < 4.4 and real_double < 4.4 andreal_decimal < 4.4 andutiny < 4 and ushort < 4 and umedium < 4 and ulong < 4 and ulonglong < 4 and /* bits < b'100' and */(options = 'one' or options = 'two' or options = 'three') and(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') anddate_field < '1904-01-01' andyear_field < '1904' andtime_field < '04:04:04' and date_time < '1904-04-04 04:04:04' order by auto;explainselect auto from t1 where string <= "dddd" and vstring <= "dddd" and bin <= 0xDDDD and vbin <= 0xDDDD andtiny >= -4 and short >= -4 and medium >= -4 and long_int >= -4 and longlong >= -4 and real_float <= 4.5 and real_double <= 4.5 and real_decimal <= 4.5 and utiny <= 4 - 1 + 1 and /* Checking function composition */ushort <= 4 and umedium <= 4 and ulong <= 4 and ulonglong <= 4 and /* bits <= b'100' and */(options = 'one' or options = 'two' or options = 'three' or options = 'four') and (flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field <= '1904-04-04' andyear_field <= '1904' andtime_field <= '04:04:04' and date_time <= '1904-04-04 04:04:04' order by auto;select auto from t1 where string <= "dddd" and vstring <= "dddd" and bin <= 0xDDDD and vbin <= 0xDDDD andtiny >= -4 and short >= -4 and medium >= -4 and long_int >= -4 and longlong >= -4 and real_float <= 4.5 and real_double <= 4.5 and real_decimal <= 4.5 and utiny <= 4 - 1 + 1 and /* Checking function composition */ushort <= 4 and umedium <= 4 and ulong <= 4 and ulonglong <= 4 and /* bits <= b'100' and */(options = 'one' or options = 'two' or options = 'three' or options = 'four') and (flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') anddate_field <= '1904-04-04' andyear_field <= '1904' andtime_field <= '04:04:04' and date_time <= '1904-04-04 04:04:04' order by auto;# Test index scan with filtercreate index medium_index on t1(medium);# Test all types and compare operatorsexplainselect auto from t1 where string = "aaaa" and vstring = "aaaa" and bin = 0xAAAA and vbin = 0xAAAA andtiny = -1 and short = -1 and medium = -1 and long_int = -1 and longlong = -1 and real_float > 1.0 and real_float < 2.0 and real_double > 1.0 and real_double < 2.0 andreal_decimal > 1.0 and real_decimal < 2.0 andutiny = 1 and ushort = 1 and umedium = 1 and ulong = 1 and ulonglong = 1 and /* bits = b'001' and */options = 'one' and flags = 'one' and date_field = '1901-01-01' andyear_field = '1901' andtime_field = '01:01:01' and date_time = '1901-01-01 01:01:01' order by auto;select auto from t1 where string = "aaaa" and vstring = "aaaa" and bin = 0xAAAA and vbin = 0xAAAA andtiny = -1 and short = -1 and medium = -1 and long_int = -1 and longlong = -1 and real_float > 1.0 and real_float < 2.0 and real_double > 1.0 and real_double < 2.0 andreal_decimal > 1.0 and real_decimal < 2.0 andutiny = 1 and ushort = 1 and umedium = 1 and ulong = 1 and ulonglong = 1 and /* bits = b'001' and */options = 'one' and flags = 'one' and date_field = '1901-01-01' andyear_field = '1901' andtime_field = '01:01:01' and date_time = '1901-01-01 01:01:01' order by auto;explainselect auto from t1 where string != "aaaa" and vstring != "aaaa" and bin != 0xAAAA and vbin != 0xAAAA andtiny != -1 and short != -1 and medium != -1 and long_int != -1 and longlong != -1 and (real_float < 1.0 or real_float > 2.0) and (real_double < 1.0 or real_double > 2.0) and(real_decimal < 1.0 or real_decimal > 2.0) andutiny != 1 and
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -