首页 > 代码库 > Query OK, 1 row affected (43.05 sec)
Query OK, 1 row affected (43.05 sec)
1 mysql> create table w0904procedure (wa char, wb char, wd char, wi char); 2 Query OK, 0 rows affected (0.00 sec) 3 4 mysql> INSERT INTO w0904procedure VALUES(NULL, 0, ‘www0904‘, ‘w0904d‘); 5 ERROR 1406 (22001): Data too long for column ‘wd‘ at row 1 6 7 mysql> desc w0904procedure; 8 +-------+---------+------+-----+---------+-------+ 9 | Field | Type | Null | Key | Default | Extra |10 +-------+---------+------+-----+---------+-------+11 | wa | char(1) | YES | | NULL | |12 | wb | char(1) | YES | | NULL | |13 | wd | char(1) | YES | | NULL | |14 | wi | char(1) | YES | | NULL | |15 +-------+---------+------+-----+---------+-------+16 4 rows in set (0.00 sec)17 18 mysql> DROP PROCEDURE IF EXISTS insert_many_rows_w0904;19 Query OK, 0 rows affected (0.00 sec)20 21 mysql> delimiter //22 mysql> CREATE PROCEDURE insert_many_rows_w0904 (IN loops INT)23 -> BEGIN24 -> DECLARE v1 INT;25 -> SET v1=loops;26 -> WHILE v1 > 0 DO27 -> INSERT INTO w0904procedure VALUES(NULL, 0, ‘w‘, ‘w‘);28 -> SET v1 = v1 - 1;29 -> END WHILE;30 -> END;31 -> //32 Query OK, 0 rows affected (0.00 sec)33 34 mysql> delimiter ;35 mysql>36 mysql> SET @loops=987987;37 Query OK, 0 rows affected (0.00 sec)38 39 mysql> CALL insert_many_rows_w0904(@loops);40 Query OK, 1 row affected (43.05 sec)41 42 43 44 mysql> SELECT * FROM w0904procedure LIMIT 20;45 +------+------+------+------+46 | wa | wb | wd | wi |47 +------+------+------+------+48 | NULL | 0 | w | w |49 | NULL | 0 | w | w |50 | NULL | 0 | w | w |51 | NULL | 0 | w | w |52 | NULL | 0 | w | w |53 | NULL | 0 | w | w |54 | NULL | 0 | w | w |55 | NULL | 0 | w | w |56 | NULL | 0 | w | w |57 | NULL | 0 | w | w |58 | NULL | 0 | w | w |59 | NULL | 0 | w | w |60 | NULL | 0 | w | w |61 | NULL | 0 | w | w |62 | NULL | 0 | w | w |63 | NULL | 0 | w | w |64 | NULL | 0 | w | w |65 | NULL | 0 | w | w |66 | NULL | 0 | w | w |67 | NULL | 0 | w | w |68 +------+------+------+------+69 20 rows in set (0.00 sec)70 71 72 mysql> SELECT COUNT(*) FROM w0904procedure;73 +----------+74 | COUNT(*) |75 +----------+76 | 987988 |77 +----------+78 1 row in set (0.00 sec)
Query OK, 1 row affected (43.05 sec)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。