insert.result
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 465 行 · 第 1/2 页
RESULT
465 行
f_double_u 1e+111f_float_u 3.40282e+38f_double_15_1_u 99999999999999.9f_float_3_1_u 99.9set @value= -1e+111;insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);Warnings:Warning 1264 Out of range value adjusted for column 'f_float' at row 1Warning 1264 Out of range value adjusted for column 'f_double_7_2' at row 1Warning 1264 Out of range value adjusted for column 'f_float_4_3' at row 1Warning 1264 Out of range value adjusted for column 'f_double_u' at row 1Warning 1264 Out of range value adjusted for column 'f_float_u' at row 1Warning 1264 Out of range value adjusted for column 'f_double_15_1_u' at row 1Warning 1264 Out of range value adjusted for column 'f_float_3_1_u' at row 1select * from t1 where number =last_insert_id();number 7original_value -1e+111f_double -1e+111f_float -3.40282e+38f_double_7_2 -99999.99f_float_4_3 -9.999f_double_u 0f_float_u 0f_double_15_1_u 0.0f_float_3_1_u 0.0set @value= 1;insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);select * from t1 where number =last_insert_id();number 8original_value 1f_double 1f_float 1f_double_7_2 1.00f_float_4_3 1.000f_double_u 1f_float_u 1f_double_15_1_u 1.0f_float_3_1_u 1.0set @value= -1;insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);Warnings:Warning 1264 Out of range value adjusted for column 'f_double_u' at row 1Warning 1264 Out of range value adjusted for column 'f_float_u' at row 1Warning 1264 Out of range value adjusted for column 'f_double_15_1_u' at row 1Warning 1264 Out of range value adjusted for column 'f_float_3_1_u' at row 1select * from t1 where number =last_insert_id();number 9original_value -1f_double -1f_float -1f_double_7_2 -1.00f_float_4_3 -1.000f_double_u 0f_float_u 0f_double_15_1_u 0.0f_float_3_1_u 0.0drop table t1;create table t1(id1 int not null auto_increment primary key, t char(12));create table t2(id2 int not null, t char(12));create table t3(id3 int not null, t char(12), index(id3));select count(*) from t2;count(*)500insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;select count(*) from t2;count(*)25500drop table t1,t2,t3;create table t1 (id int primary key, data int);insert into t1 values (1, 1), (2, 2), (3, 3);select row_count();row_count()3insert ignore into t1 values (1, 1);select row_count();row_count()0replace into t1 values (1, 11);select row_count();row_count()2replace into t1 values (4, 4);select row_count();row_count()1insert into t1 values (2, 2) on duplicate key update data= data + 10;select row_count();row_count()2insert into t1 values (5, 5) on duplicate key update data= data + 10;select row_count();row_count()1drop table t1;create table t1 (f1 int unique, f2 int);create table t2 (f3 int, f4 int);create view v1 as select * from t1, t2 where f1= f3;insert into t1 values (1,11), (2,22);insert into t2 values (1,12), (2,24);insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;ERROR HY000: Can not modify more than one base table through a join view 'test.v1'insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;select * from t1;f1 f21 112 223 NULLinsert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;select * from t1;f1 f21 112 2212 NULLdrop view v1;drop table t1,t2;DROP TABLE IF EXISTS t1;DROP FUNCTION IF EXISTS f1;DROP FUNCTION IF EXISTS f2;CREATE TABLE t1 (i INT);CREATE FUNCTION f1() RETURNS INTBEGININSERT INTO t1 VALUES (1);RETURN 1;END |CREATE FUNCTION f2() RETURNS INTBEGININSERT DELAYED INTO t1 VALUES (2);RETURN 1;END |SELECT f1();f1()1SELECT f2();f2()1INSERT INTO t1 VALUES (3);INSERT DELAYED INTO t1 VALUES (4);INSERT INTO t1 VALUES (f1());ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.INSERT DELAYED INTO t1 VALUES (f1());ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.INSERT INTO t1 VALUES (f2());ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.INSERT DELAYED INTO t1 VALUES (f2());ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROWINSERT INTO t1 VALUES (NEW.i);INSERT INTO t1 VALUES (1);ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.INSERT DELAYED INTO t1 VALUES (1);ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.SELECT * FROM t1;i1234DROP FUNCTION f2;DROP FUNCTION f1;DROP TABLE t1;DROP TABLE IF EXISTS t1, t2;CREATE TABLE t1 (i INT);CREATE TABLE t2 (i INT);CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROWINSERT DELAYED INTO t2 VALUES (NEW.i);CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROWINSERT DELAYED INTO t2 VALUES (NEW.i);CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROWINSERT DELAYED INTO t2 VALUES (OLD.i);INSERT INTO t1 VALUES (1);INSERT DELAYED INTO t1 VALUES (2);SELECT * FROM t1;i12UPDATE t1 SET i = 3 WHERE i = 1;SELECT * FROM t1;i32DELETE FROM t1 WHERE i = 3;SELECT * FROM t1;i2SELECT * FROM t2;i1233DROP TABLE t1, t2;DROP TABLE IF EXISTS t1, t2;CREATE TABLE t1 (i INT);CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROWSET @a= NEW.i;SET @a= 0;INSERT DELAYED INTO t1 VALUES (1);SELECT @a;@a1INSERT DELAYED INTO t1 VALUES (2);SELECT @a;@a2DROP TABLE t1;CREATE TABLE t1 (i INT);CREATE TABLE t2 (i INT);CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROWINSERT INTO t2 VALUES (NEW.i);CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROWINSERT DELAYED INTO t2 VALUES (NEW.i);CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROWINSERT DELAYED INTO t2 VALUES (OLD.i);INSERT DELAYED INTO t1 VALUES (1);SELECT * FROM t1;i1UPDATE t1 SET i = 2 WHERE i = 1;SELECT * FROM t1;i2DELETE FROM t1 WHERE i = 2;SELECT * FROM t1;iSELECT * FROM t2;i122DROP TABLE t1, t2;End of 5.0 tests.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?