Quelle function_defaults_notembedded.result
Sprache: Lisp
#
# Test of function defaults for non-embedded server.
#
#
# Function defaults run 1. No microsecond precision.
# SET TIME_ZONE = "+00:00";
#
# Test of INSERT DELAYED ... SET ...
#
# 2011-04-1908:02:40 UTC SET TIMESTAMP = 1303200160.123456;
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT DELAYED INTO t1 SET a = 1;
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:02:40
SELECT * FROM t1 WHERE b = 0;
a b
INSERT DELAYED INTO t1 SET a = 2, b = '1980-01-02 10:20:30.405060';
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:02:40 21980-01-0210:20:30
DROP TABLE t1;
#
# Test of INSERT DELAYED ... VALUES ...
#
# 2011-04-1908:04:01 UTC SET TIMESTAMP = 1303200241.234567;
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT DELAYED INTO t1 ( a ) VALUES (1);
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:04:01
INSERT DELAYED INTO t1 VALUES (2, '1977-12-19 12:34:56.789123');
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:04:01 21977-12-1912:34:56
DROP TABLE t1;
#
# Test of a delayed insert handler servicing two insert operations
# with different sets of active defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
connect con1, localhost, root,,;
# 2011-04-1908:04:01 UTC SET TIMESTAMP = 1303200241.345678; SET debug_sync = 'before_write_delayed SIGNAL parked WAIT_FOR go';
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3);
connection default; SET debug_sync = 'now WAIT_FOR parked';
connect con2, localhost, root,,;
# 2011-04-1908:04:01 UTC SET TIME_ZONE="+03:00"; SET TIMESTAMP = 1303200241.456789;
INSERT DELAYED INTO t1 ( a, b ) VALUES (4, '1977-12-19 12:34:56.789123'), (5, '1977-12-19 12:34:57.891234'), (6, '1977-12-19 12:34:58.912345');
connection default; SET debug_sync = 'now SIGNAL go';
SELECT * FROM t1;
a b 12011-04-1908:04:01 22011-04-1908:04:01 32011-04-1908:04:01 41977-12-1909:34:56 51977-12-1909:34:57 61977-12-1909:34:58
disconnect con1;
disconnect con2;
DROP TABLE t1;
#
# Test of early activation of function defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); SET TIMESTAMP = 1317235172.987654;
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3); SET TIMESTAMP = 385503754.876543;
INSERT DELAYED INTO t1 ( a ) VALUES (4), (5), (6);
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-09-2818:39:32 22011-09-2818:39:32 32011-09-2818:39:32 41982-03-2020:22:34 51982-03-2020:22:34 61982-03-2020:22:34
DROP TABLE t1; SET debug_sync = 'RESET';
#
# Function defaults run 2. Six digits scale on seconds precision.
# SET TIME_ZONE = "+00:00";
#
# Test of INSERT DELAYED ... SET ...
#
# 2011-04-1908:02:40 UTC SET TIMESTAMP = 1303200160.123456;
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
INSERT DELAYED INTO t1 SET a = 1;
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:02:40.123456
SELECT * FROM t1 WHERE b = 0;
a b
INSERT DELAYED INTO t1 SET a = 2, b = '1980-01-02 10:20:30.405060';
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:02:40.123456 21980-01-0210:20:30.405060
DROP TABLE t1;
#
# Test of INSERT DELAYED ... VALUES ...
#
# 2011-04-1908:04:01 UTC SET TIMESTAMP = 1303200241.234567;
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
INSERT DELAYED INTO t1 ( a ) VALUES (1);
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:04:01.234567
INSERT DELAYED INTO t1 VALUES (2, '1977-12-19 12:34:56.789123');
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-04-1908:04:01.234567 21977-12-1912:34:56.789123
DROP TABLE t1;
#
# Test of a delayed insert handler servicing two insert operations
# with different sets of active defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
connect con1, localhost, root,,;
# 2011-04-1908:04:01 UTC SET TIMESTAMP = 1303200241.345678; SET debug_sync = 'before_write_delayed SIGNAL parked WAIT_FOR go';
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3);
connection default; SET debug_sync = 'now WAIT_FOR parked';
connect con2, localhost, root,,;
# 2011-04-1908:04:01 UTC SET TIME_ZONE="+03:00"; SET TIMESTAMP = 1303200241.456789;
INSERT DELAYED INTO t1 ( a, b ) VALUES (4, '1977-12-19 12:34:56.789123'), (5, '1977-12-19 12:34:57.891234'), (6, '1977-12-19 12:34:58.912345');
connection default; SET debug_sync = 'now SIGNAL go';
SELECT * FROM t1;
a b 12011-04-1908:04:01.345678 22011-04-1908:04:01.345678 32011-04-1908:04:01.345678 41977-12-1909:34:56.789123 51977-12-1909:34:57.891234 61977-12-1909:34:58.912345
disconnect con1;
disconnect con2;
DROP TABLE t1;
#
# Test of early activation of function defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)); SET TIMESTAMP = 1317235172.987654;
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3); SET TIMESTAMP = 385503754.876543;
INSERT DELAYED INTO t1 ( a ) VALUES (4), (5), (6);
FLUSH TABLE t1;
SELECT * FROM t1;
a b 12011-09-2818:39:32.987654 22011-09-2818:39:32.987654 32011-09-2818:39:32.987654 41982-03-2020:22:34.876543 51982-03-2020:22:34.876543 61982-03-2020:22:34.876543
DROP TABLE t1; SET debug_sync = 'RESET';
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.