Wait for INSERT DELAYED to finish i.e sleep in while loop until

"select count" is one more.
parent 98e062a9
...@@ -11120,7 +11120,13 @@ auto fld1 companynr fld3 fld4 fld5 fld6 ...@@ -11120,7 +11120,13 @@ auto fld1 companynr fld3 fld4 fld5 fld6
2 011401 37 breaking dreaded Steinberg W 2 011401 37 breaking dreaded Steinberg W
3 011402 37 Romans scholastics jarring 3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily 4 011403 37 intercepted audiology tinily
SELECT COUNT(auto) FROM t2;
COUNT(auto)
1213
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
SELECT COUNT(auto) FROM t2;
COUNT(auto)
1214
ALTER TABLE t2 DROP COLUMN fld6; ALTER TABLE t2 DROP COLUMN fld6;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
......
...@@ -1345,10 +1345,14 @@ SELECT * FROM t2; ...@@ -1345,10 +1345,14 @@ SELECT * FROM t2;
CHECK TABLE t2; CHECK TABLE t2;
SELECT * FROM t2; SELECT * FROM t2;
# Test INSERT DELAYED and wait until the table has one more record
# Just test syntax, we will never know if the output is right or wrong SELECT COUNT(auto) FROM t2;
# Must be the last test
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
while (`SELECT COUNT(auto)!=1214 FROM t2`)
{
sleep 0.1;
}
SELECT COUNT(auto) FROM t2;
# Adding test for alter table # Adding test for alter table
ALTER TABLE t2 DROP COLUMN fld6; ALTER TABLE t2 DROP COLUMN fld6;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment