?? dynamiclikeoptimization.out
字號:
null qualifiers:Column[0][0] Id: 2Operator: <Ordered nulls: falseUnknown return value: trueNegate comparison result: trueColumn[0][1] Id: 2Operator: <Order&ij> create index i1 on test(vc10);0 rows inserted/updated/deletedij> create table likeable (match_me varchar(10), pattern varchar(10), esc varchar(1));0 rows inserted/updated/deletedij> insert into likeable values ('foo%bar', 'fooZ%bar', 'Z');1 row inserted/updated/deletedij> insert into likeable values ('foo%bar', '%Z%ba_', 'Z');1 row inserted/updated/deletedij> insert into likeable values ('foo%bar', 'fooZ%baZ', 'Z');1 row inserted/updated/deletedij> -- errorselect match_me from likeable where match_me like pattern escape esc;ERROR 42824: An operand of LIKE is not a string, or the first operand is not a column.ij> delete from likeable;3 rows inserted/updated/deletedij> insert into likeable values ('foo%bar', 'foo%bar', NULL);1 row inserted/updated/deletedij> -- should errorselect match_me from likeable where match_me like pattern escape esc;ERROR 42824: An operand of LIKE is not a string, or the first operand is not a column.ij> delete from likeable;1 row inserted/updated/deletedij> insert into likeable values ('foo%bar', 'foo%bar', '');1 row inserted/updated/deletedij> -- should errorselect match_me from likeable where match_me like pattern escape esc;ERROR 42824: An operand of LIKE is not a string, or the first operand is not a column.ij> -- Defect 6002/6039create table cei(id int, name varchar(192) not null, source varchar(252) not null);0 rows inserted/updated/deletedij> insert into cei values (1, 'Alarms', 'AlarmDisk999'), (2, 'Alarms', 'AlarmFS-usr'), (3, 'Alarms', 'AlarmPower'), (4, 'Alert', 'AlertBattery'), (5, 'Alert', 'AlertUPS'), (6, 'Warning', 'WarnIntrusion'), (7, 'Warning', 'WarnUnlockDoor'), (8, 'Warning', 'Warn%Unlock%Door'), (9, 'Warning', 'W_Unlock_Door');9 rows inserted/updated/deletedij> select * from cei;ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 |Alarms |AlarmDisk999 2 |Alarms |AlarmFS-usr 3 |Alarms |AlarmPower 4 |Alert |AlertBattery 5 |Alert |AlertUPS 6 |Warning |WarnIntrusion 7 |Warning |WarnUnlockDoor 8 |Warning |Warn%Unlock%Door 9 |Warning |W_Unlock_Door ij> prepare s as 'select id, name, source from cei where (name LIKE ? escape ''\'') and (source like ? escape ''\'') order by source asc, name asc';ij> execute s using 'values (''%'', ''%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 |Alarms |AlarmDisk999 2 |Alarms |AlarmFS-usr 3 |Alarms |AlarmPower 4 |Alert |AlertBattery 5 |Alert |AlertUPS 9 |Warning |W_Unlock_Door 8 |Warning |Warn%Unlock%Door 6 |Warning |WarnIntrusion 7 |Warning |WarnUnlockDoor ij> execute s using 'values (''Alarms'', ''AlarmDisk%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 |Alarms |AlarmDisk999 ij> execute s using 'values (''A%'', ''%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 |Alarms |AlarmDisk999 2 |Alarms |AlarmFS-usr 3 |Alarms |AlarmPower 4 |Alert |AlertBattery 5 |Alert |AlertUPS ij> execute s using 'values (''%'', ''___rm%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 |Alarms |AlarmDisk999 2 |Alarms |AlarmFS-usr 3 |Alarms |AlarmPower ij> execute s using 'values (''Warning'', ''%oor'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------9 |Warning |W_Unlock_Door 8 |Warning |Warn%Unlock%Door 7 |Warning |WarnUnlockDoor ij> execute s using 'values (''Warning'', ''Warn\%Unlock\%Door'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------8 |Warning |Warn%Unlock%Door ij> execute s using 'values (''Warning'', ''%\%Unlo%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------8 |Warning |Warn%Unlock%Door ij> execute s using 'values (''Warning'', ''W\_Unloc%'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------9 |Warning |W_Unlock_Door ij> execute s using 'values (''Warning'', ''_\_Unlock\_Door'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------9 |Warning |W_Unlock_Door ij> execute s using 'values (''W%'', ''Warn\%Unlock\%Door'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------8 |Warning |Warn%Unlock%Door ij> execute s using 'values (''%ing'', ''W\_Unlock\_%Door'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------9 |Warning |W_Unlock_Door ij> execute s using 'values (''Bogus'', ''Name'')';ID |NAME |SOURCE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ij> -- test control charactersinsert into test values ('asdp', 'asdp', 'asdp');1 row inserted/updated/deletedij> insert into test values ('aseg', 'aseg', 'aseg');1 row inserted/updated/deletedij> prepare p1 as 'select id from test where c10 like ?';ij> execute p1 using 'values ''asd%'' ';ID ----------asdf asdg asdp ij> select c10 from test where c10 like 'asd%';C10 ----------asdf asdg asdp ij> -- escaped escape character preceding first wildcard (DERBY-1386)insert into test values ('abc#def', 'abc#def', 'abc#def');1 row inserted/updated/deletedij> insert into test values ('abc\def', 'abc\def', 'abc\def');1 row inserted/updated/deletedij> select id from test where c10 like 'abc##%' escape '#';ID ----------abc#def ij> select id from test where vc10 like 'abc##%' escape '#';ID ----------abc#def ij> select id from test where c10 like 'abc\\%' escape '\';ID ----------abc\def ij> select id from test where vc10 like 'abc\\%' escape '\';ID ----------abc\def ij> select id from test where c10 like 'abc##_ef' escape '#';ID ----------ij> select id from test where vc10 like 'abc##_ef' escape '#';ID ----------abc#def ij> select id from test where c10 like 'abc\\_ef' escape '\';ID ----------ij> select id from test where vc10 like 'abc\\_ef' escape '\';ID ----------abc\def ij> -- clean updrop table test;0 rows inserted/updated/deletedij> drop table likeable;0 rows inserted/updated/deletedij> drop table cei;0 rows inserted/updated/deletedij>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -