2023-11-20 08:32:44 +00:00

66 lines
3.1 KiB
Plaintext

drop table if exists test;
create table test(a int,b int primary key);
insert into test values(1,1);
insert into test values(1,2);
insert into test values(1,3);
insert into test values(1,4);
select * from test;
a b
1 1
1 2
1 3
1 4
explain select * from test;
desc select * from test;
describe select * from test;
explain insert into test values(1,5);
desc insert into test values(1,5);
describe insert into test values(1,5);
explain insert into test values(1,4);
desc insert into test values(1,4);
describe insert into test values(1,4);
explain update test set a=2 where b=2;
desc update test set a=2 where b=2;
describe update test set a=2 where b=2;
explain update test set b=2 where a=1;
desc update test set b=2 where a=1;
describe update test set b=2 where a=1;
explain delete from test where b=5;
desc delete from test where b=5;
describe delete from test where b=5;
explain create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
desc create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
describe create table test(a int,b int primary key);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'create table test(a int,b int primary key)' at line 1
explain drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
desc drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
describe drop table test;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'drop table test' at line 1
drop table if exists sd;
create table sd(a int);
insert into sd values(5),(4),(4),(3),(2),(2),(2),(1);
explain select @rownum := @rownum + 1 as row, @rank := IF(@prev_score!=a, @rownum, @rank) as rank, @prev_score := a as score from sd;
explain outline select 1 < '2009-12-17 06:03:17';
Query Plan
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([cast(1, DECIMAL(1, 0)) < cast('2009-12-17 06:03:17', DECIMAL(1, -1))]), filter(nil)
values({cast(1, DECIMAL(1, 0)) < cast('2009-12-17 06:03:17', DECIMAL(1, -1))})
Outline Data:
-------------------------------------
/*+
BEGIN_OUTLINE_DATA
OPTIMIZER_FEATURES_ENABLE('4.0.0.0')
END_OUTLINE_DATA
*/
drop table sd;