📄 sp.result
字号:
set v = default;set x = v;end|drop procedure if exists bug2776_2|create procedure bug2776_2(out x int)begindeclare v int default 42;set v = default;set x = v;end|set @x = 1|call bug2776_1(@x)|select @x|@xNULLcall bug2776_2(@x)|select @x|@x42drop procedure bug2776_1|drop procedure bug2776_2|create table t3 (s1 smallint)|insert into t3 values (123456789012)|Warnings:Warning 1264 Out of range value for column 's1' at row 1drop procedure if exists bug2780|create procedure bug2780()begindeclare exit handler for sqlwarning set @x = 1; set @x = 0;insert into t3 values (123456789012);insert into t3 values (0);end|call bug2780()|select @x|@x1select * from t3|s13276732767drop procedure bug2780|drop table t3|create table t3 (content varchar(10) )|insert into t3 values ("test1")|insert into t3 values ("test2")|create table t4 (f1 int, rc int, t3 int)|drop procedure if exists bug1863|create procedure bug1863(in1 int)begin declare ind int default 0;declare t1 int;declare t2 int;declare t3 int;declare rc int default 0;declare continue handler for 1065 set rc = 1;drop temporary table if exists temp_t1;create temporary table temp_t1 (f1 int auto_increment, f2 varchar(20), primary key (f1));insert into temp_t1 (f2) select content from t3;select f2 into t3 from temp_t1 where f1 = 10;if (rc) theninsert into t4 values (1, rc, t3);end if;insert into t4 values (2, rc, t3);end|call bug1863(10)|Warnings:Note 1051 Unknown table 'temp_t1'Warning 1329 No data to FETCHcall bug1863(10)|Warnings:Warning 1329 No data to FETCHselect * from t4|f1 rc t32 0 NULL2 0 NULLdrop procedure bug1863|drop temporary table temp_t1;drop table t3, t4|create table t3 ( OrderID int not null,MarketID int,primary key (OrderID))|create table t4 ( MarketID int not null,Market varchar(60),Status char(1),primary key (MarketID))|insert t3 (OrderID,MarketID) values (1,1)|insert t3 (OrderID,MarketID) values (2,2)|insert t4 (MarketID,Market,Status) values (1,"MarketID One","A")|insert t4 (MarketID,Market,Status) values (2,"MarketID Two","A")|drop procedure if exists bug2656_1|create procedure bug2656_1()begin selectm.Marketfrom t4 m JOIN t3 o ON o.MarketID != 1 and o.MarketID = m.MarketID;end |drop procedure if exists bug2656_2|create procedure bug2656_2()begin selectm.Marketfrom t4 m, t3 owhere m.MarketID != 1 and m.MarketID = o.MarketID;end |call bug2656_1()|MarketMarketID Twocall bug2656_1()|MarketMarketID Twocall bug2656_2()|MarketMarketID Twocall bug2656_2()|MarketMarketID Twodrop procedure bug2656_1|drop procedure bug2656_2|drop table t3, t4|drop procedure if exists bug3426|create procedure bug3426(in_time int unsigned, out x int)beginif in_time is null thenset @stamped_time=10;set x=1;elseset @stamped_time=in_time;set x=2;end if;end|call bug3426(1000, @i)|select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|@i time2 01-01-1970 03:16:40call bug3426(NULL, @i)|select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|@i time1 01-01-1970 03:00:10alter procedure bug3426 sql security invoker|call bug3426(NULL, @i)|select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|@i time1 01-01-1970 03:00:10call bug3426(1000, @i)|select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|@i time2 01-01-1970 03:16:40drop procedure bug3426|create table t3 (a int primary key, ach char(1)) engine = innodb|create table t4 (b int primary key , bch char(1)) engine = innodb|insert into t3 values (1 , 'aCh1' ) , ('2' , 'aCh2')|Warnings:Warning 1265 Data truncated for column 'ach' at row 1Warning 1265 Data truncated for column 'ach' at row 2insert into t4 values (1 , 'bCh1' )|Warnings:Warning 1265 Data truncated for column 'bch' at row 1drop procedure if exists bug3448|create procedure bug3448()select * from t3 inner join t4 on t3.a = t4.b|select * from t3 inner join t4 on t3.a = t4.b|a ach b bch1 a 1 bcall bug3448()|a ach b bch1 a 1 bcall bug3448()|a ach b bch1 a 1 bdrop procedure bug3448|drop table t3, t4|create table t3 (id int unsigned auto_increment not null primary key,title VARCHAR(200),body text,fulltext (title,body))|insert into t3 (title,body) values('MySQL Tutorial','DBMS stands for DataBase ...'),('How To Use MySQL Well','After you went through a ...'),('Optimizing MySQL','In this tutorial we will show ...'),('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),('MySQL vs. YourSQL','In the following database comparison ...'),('MySQL Security','When configured properly, MySQL ...')|drop procedure if exists bug3734 |create procedure bug3734 (param1 varchar(100))select * from t3 where match (title,body) against (param1)|call bug3734('database')|id title body5 MySQL vs. YourSQL In the following database comparison ...1 MySQL Tutorial DBMS stands for DataBase ...call bug3734('Security')|id title body6 MySQL Security When configured properly, MySQL ...drop procedure bug3734|drop table t3|drop procedure if exists bug3863|create procedure bug3863()beginset @a = 0;while @a < 5 doset @a = @a + 1;end while;end|call bug3863()|select @a|@a5call bug3863()|select @a|@a5drop procedure bug3863|create table t3 (id int(10) unsigned not null default 0,rid int(10) unsigned not null default 0,msg text not null,primary key (id),unique key rid (rid, id))|drop procedure if exists bug2460_1|create procedure bug2460_1(in v int)begin( select n0.id from t3 as n0 where n0.id = v )union( select n0.id from t3 as n0, t3 as n1where n0.id = n1.rid and n1.id = v )union( select n0.id from t3 as n0, t3 as n1, t3 as n2where n0.id = n1.rid and n1.id = n2.rid and n2.id = v );end|call bug2460_1(2)|idcall bug2460_1(2)|idinsert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')|call bug2460_1(2)|id21call bug2460_1(2)|id21drop procedure if exists bug2460_2|create procedure bug2460_2()begindrop table if exists t3;create temporary table t3 (s1 int);insert into t3 select 1 union select 1;end|call bug2460_2()|call bug2460_2()|select * from t3|s11drop procedure bug2460_1|drop procedure bug2460_2|drop table t3|set @@sql_mode = ''|drop procedure if exists bug2564_1|create procedure bug2564_1()comment 'Joe''s procedure' insert into `t1` values ("foo", 1)|set @@sql_mode = 'ANSI_QUOTES'|drop procedure if exists bug2564_2|create procedure bug2564_2()insert into "t1" values ('foo', 1)|set @@sql_mode = ''$drop function if exists bug2564_3$create function bug2564_3(x int, y int) returns intreturn x || y$set @@sql_mode = 'ANSI'$drop function if exists bug2564_4$create function bug2564_4(x int, y int) returns intreturn x || y$set @@sql_mode = ''|show create procedure bug2564_1|Procedure sql_mode Create Procedurebug2564_1 CREATE PROCEDURE `bug2564_1`() COMMENT 'Joe''s procedure'insert into `t1` values ("foo", 1)show create procedure bug2564_2|Procedure sql_mode Create Procedurebug2564_2 ANSI_QUOTES CREATE PROCEDURE "bug2564_2"()insert into "t1" values ('foo', 1)show create function bug2564_3|Function sql_mode Create Functionbug2564_3 CREATE FUNCTION `bug2564_3`(x int, y int) RETURNS int(11)return x || yshow create function bug2564_4|Function sql_mode Create Functionbug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE FUNCTION "bug2564_4"(x int, y int) RETURNS int(11)return x || ydrop procedure bug2564_1|drop procedure bug2564_2|drop function bug2564_3|drop function bug2564_4|drop function if exists bug3132|create function bug3132(s char(20)) returns char(50)return concat('Hello, ', s, '!')|select bug3132('Bob') union all select bug3132('Judy')|bug3132('Bob')Hello, Bob!Hello, Judy!drop function bug3132|drop procedure if exists bug3843|create procedure bug3843()analyze table t1|call bug3843()|Table Op Msg_type Msg_texttest.t1 analyze status OKcall bug3843()|Table Op Msg_type Msg_texttest.t1 analyze status Table is already up to dateselect 1+2|1+23drop procedure bug3843|create table t3 ( s1 char(10) )|insert into t3 values ('a'), ('b')|drop procedure if exists bug3368|create procedure bug3368(v char(10))beginselect group_concat(v) from t3;end|call bug3368('x')|group_concat(v)x,xcall bug3368('yz')|group_concat(v)yz,yzdrop procedure bug3368|drop table t3|create table t3 (f1 int, f2 int)|insert into t3 values (1,1)|drop procedure if exists bug4579_1|create procedure bug4579_1 ()begindeclare sf1 int;select f1 into sf1 from t3 where f1=1 and f2=1;update t3 set f2 = f2 + 1 where f1=1 and f2=1;call bug4579_2();end|drop procedure if exists bug4579_2|create procedure bug4579_2 ()beginend|call bug4579_1()|call bug4579_1()|Warnings:Warning 1329 No data to FETCHcall bug4579_1()|Warnings:Warning 1329 No data to FETCHdrop procedure bug4579_1|drop procedure bug4579_2|drop table t3|drop procedure if exists bug2773|create function bug2773() returns int return null|create table t3 as select bug2773()|show create table t3|Table Create Tablet3 CREATE TABLE `t3` ( `bug2773()` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1drop table t3|drop function bug2773|drop procedure if exists bug3788|create function bug3788() returns date return cast("2005-03-04" as date)|select bug3788()|bug3788()2005-03-04drop function bug3788|create function bug3788() returns binary(1) return 5|select bug3788()|bug3788()5drop function bug3788|create table t3 (f1 int, f2 int, f3 int)|insert into t3 values (1,1,1)|drop procedure if exists bug4726|create procedure bug4726()begindeclare tmp_o_id INT;declare tmp_d_id INT default 1;while tmp_d_id <= 2 dobeginselect f1 into tmp_o_id from t3 where f2=1 and f3=1;set tmp_d_id = tmp_d_id + 1;end;end while;end|call bug4726()|call bug4726()|call bug4726()|drop procedure bug4726|drop table t3|drop procedure if exists bug4902|create procedure bug4902()beginshow charset like 'foo';show collation like 'foo';show column types;show create table t1;show create database test;show databases like 'foo';show errors;show columns from t1;show keys from t1;show open tables like 'foo';show privileges;show status like 'foo';show tables like 'foo';show variables like 'foo';show warnings;end|call bug4902()|Charset Description Default collation MaxlenCollation Charset Id Default Compiled SortlenType Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Commenttinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integertinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integerTable Create Tablet1 CREATE TABLE `t1` ( `id` char(16) NOT NULL default '', `data` int(11) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1Database Create Databasetest CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */Database (foo)Level Code MessageField Type Null Key Default Extraid char(16) NO data int(11) NO Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type CommentDatabase Table In_use Name_lockedPrivilege Context CommentAlter Tables To alter the tableAlter routine Functions,Procedures To alter or drop stored functions/proceduresCreate Databases,Tables,Indexes To create new databases and tablesCreate routine Functions,Procedures To use CREATE FUNCTION/PROCEDURECreate temporary tables Databases To use CREATE TEMPORARY TABLECreate view Tables To create new viewsCreate user Server Admin To create new usersDelete Tables To delete existing rowsDrop Databases,Tables To drop databases, tables, and viewsEvent Server Admin Creation, alteration, deletion and execution of events.Execute Functions,Procedures To execute stored routinesFile File access on server To read and write files on the serverGrant option Databases,Tables,Functions,Procedures To give to other users those privileges you possessIndex Tables To create or drop indexesInsert Tables To insert data into tablesLock tables Databases To use LOCK TABLES (together with SELECT privilege)Process Server Admin To view the plain text of currently executing queriesReferences Databases,Tables To have references on tablesReload Server Admin To reload or refresh tables, logs and privilegesReplication client Server Admin To ask where the slave or master servers areReplication slave Server Admin To read binary log events from the masterSelect Tables To retrieve rows from tableShow databases Server Admin To see all databases with SHOW DATABASESShow view Tables To see views with SHOW CREATE VIEWShutdown Server Admin To shut down the serverSuper Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.Trigger Tables To use triggersUpdate Tables To update existing rowsUsage Server Admin No privileges - allow connect onlyVariable_name ValueTables_in_test (foo)Variable_name ValueLevel Code Messagecall bug4902()|Charset Description Default collation MaxlenCollation Charset Id Default Compiled SortlenType Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Commenttinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integertinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integerTable Create Tablet1 CREATE TABLE `t1` ( `id` char(16) NOT NULL default '', `data` int(11) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1Database Create Databasetest CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */Database (foo)Level Code MessageField Type Null Key Default Extraid char(16) NO data int(11) NO Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type CommentDatabase Table In_use Name_lockedPrivilege Context CommentAlter Tables To alter the tableAlter routine Functions,Procedures To alter or drop stored functions/proceduresCreate Databases,Tables,Indexes To create new databases and tablesCreate routine Functions,Procedures To use CREATE FUNCTION/PROCEDURECreate temporary tables Databases To use CREATE TEMPORARY TABLECreate view Tables To create new viewsCreate user Server Admin To create new usersDelete Tables To delete existing rowsDrop Databases,Tables To drop databases, tables, and viewsEvent Server Admin Creation, alteration, deletion and execution of events.Execute Functions,Procedures To execute stored routinesFile File access on server To read and write files on the serverGrant option Databases,Tables,Functions,Procedures To give to other users those privileges you possessIndex Tables To create or drop indexesInsert Tables To insert data into tablesLock tables Databases To use LOCK TABLES (together with SELECT privilege)Process Server Admin To view the plain text of currently executing queriesReferences Databases,Tables To have references on tablesReload Server Admin To reload or refresh tables, logs and privilegesReplication client Server Admin To ask where the slave or master servers areReplication slave Server Admin To read binary log events from the masterSelect Tables To retrieve rows from tableShow databases Server Admin To see all databases with SHOW DATABASESShow view Tables To see views with SHOW CREATE VIEWShutdown Server Admin To shut down the serverSuper Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.Trigger Tables To use triggersUpdate Tables To update existing rowsUsage Server Admin No privileges - allow connect onlyVariable_name ValueTables_in_test (foo)Variable_name ValueLevel Code Messagedrop procedure bug4902|drop procedure if exists bug4904|create procedure bug4904()begindeclare continue handler for sqlstate 'HY000' begin end;create table t2 as select * from t3;end|call bug4904()|ERROR 42S02: Table 'test.t3' doesn't existdrop procedure bug4904|create table t3 (s1 char character set latin1, s2 char character set latin2)|drop procedure if exists bug4904|create procedure bug4904 ()begindeclare continue handler for sqlstate 'HY000' begin end;select s1 from t3 union select s2 from t3; end|call bug4904()|drop procedure bug4904|drop table t3|drop procedure if exists bug336|create procedure bug336(out y int)begindeclare x int;set x = (select sum(t.data) from test.t1 t);set y = x;end|insert into t1 values ("a", 2), ("b", 3)|call bug336(@y)|select @y|@y5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -