~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/drizzledump_restore.result

  • Committer: Stewart Smith
  • Date: 2009-05-15 06:57:12 UTC
  • mto: (991.1.5 for-brian)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: stewart@flamingspork.com-20090515065712-bmionylacjmexmmm
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle.

Also fix DEFAULT keyword handling for auto-increment so that it defaults to
NULL and not 0 so that the following is valid and generates two auto-inc
values:

create table t1 (a int auto_increment primary key)
insert into t1 (a) values (default);
insert into t1 (a) values (default);

Important to note that 0 is no longer magic. So this gives you duplicate
primary key error:

insert into t1 (a) values(0);
insert into t1 (a) values(0);

as you've inserted the explicit value of 0 twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Pre-test cleanup
2
 
DROP TABLE IF EXISTS t1;
3
 
# Begin tests
4
 
#
5
 
# Bug#2005 Long decimal comparison bug.
6
 
#
7
 
CREATE TABLE t1 (a DECIMAL(64, 20));
8
 
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
9
 
("0987654321098765432109876543210987654321");
10
 
# Begin testing drizzledump output + restore
11
 
# Create 'original table name - <table>_orig
12
 
SET @orig_table_name = CONCAT('test.t1', '_orig');
13
 
# Rename original table
14
 
ALTER TABLE test.t1 RENAME to test.t1_orig;
15
 
# Recreate table from drizzledump output
16
 
# Compare original and recreated tables
17
 
# Recreated table: test.t1
18
 
# Original table: test.t1_orig
19
 
Comparing tables test.t1 and test.t1_orig
20
 
# Cleanup
21
 
DROP TABLE test.t1, test.t1_orig;
22
 
#
23
 
# Bug#3361 mysqldump quotes DECIMAL values inconsistently
24
 
#
25
 
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
26
 
INSERT INTO t1 VALUES (1.2345, 2.3456);
27
 
INSERT INTO t1 VALUES ('1.2345', 2.3456);
28
 
INSERT INTO t1 VALUES ("1.2345", 2.3456);
29
 
INSERT INTO t1 VALUES (1.2345, 2.3456);
30
 
INSERT INTO t1 VALUES ('1.2345', 2.3456);
31
 
INSERT INTO t1 VALUES ("1.2345", 2.3456);
32
 
# Begin testing drizzledump output + restore
33
 
# Create 'original table name - <table>_orig
34
 
SET @orig_table_name = CONCAT('test.t1', '_orig');
35
 
# Rename original table
36
 
ALTER TABLE test.t1 RENAME to test.t1_orig;
37
 
# Recreate table from drizzledump output
38
 
# Compare original and recreated tables
39
 
# Recreated table: test.t1
40
 
# Original table: test.t1_orig
41
 
Comparing tables test.t1 and test.t1_orig
42
 
# Cleanup
43
 
DROP TABLE test.t1, test.t1_orig;
44
 
#
45
 
# WL#2319 Exclude Tables from dump
46
 
#
47
 
CREATE TABLE t1 (a INT);
48
 
CREATE TABLE t2 (a INT);
49
 
INSERT INTO t1 VALUES (1),(2),(3);
50
 
INSERT INTO t2 VALUES (4),(5),(6);
51
 
# Begin testing drizzledump output + restore
52
 
# Create 'original table name - <table>_orig
53
 
SET @orig_table_name = CONCAT('test.t2', '_orig');
54
 
# Rename original table
55
 
ALTER TABLE test.t2 RENAME to test.t2_orig;
56
 
# Recreate table from drizzledump output
57
 
# Compare original and recreated tables
58
 
# Recreated table: test.t2
59
 
# Original table: test.t2_orig
60
 
Comparing tables test.t2 and test.t2_orig
61
 
# Cleanup
62
 
DROP TABLE test.t2, test.t2_orig;
63
 
DROP TABLE t1;
64
 
#
65
 
# Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
66
 
#
67
 
CREATE TABLE t1 (`b` blob);
68
 
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
69
 
# Begin testing drizzledump output + restore
70
 
# Create 'original table name - <table>_orig
71
 
SET @orig_table_name = CONCAT('test.t1', '_orig');
72
 
# Rename original table
73
 
ALTER TABLE test.t1 RENAME to test.t1_orig;
74
 
# Recreate table from drizzledump output
75
 
# Compare original and recreated tables
76
 
# Recreated table: test.t1
77
 
# Original table: test.t1_orig
78
 
Comparing tables test.t1 and test.t1_orig
79
 
# Cleanup
80
 
DROP TABLE test.t1, test.t1_orig;
81
 
#
82
 
# Bug#550091 in Drizzle: "drizzledump dumps data_dictionary"
83
 
#
84
 
CREATE TABLE t1 (a char(100), b int);
85
 
INSERT INTO t1 values ('a',100);
86
 
INSERT INTO t1 values ('b',200);
87
 
CREATE SCHEMA drizzledump_test;
88
 
USE drizzledump_test;
89
 
CREATE TABLE t1 (a int, b char(100));
90
 
INSERT INTO t1 VALUES (1, 'abbazabba');
91
 
DROP original schemas
92
 
DROP DATABASE test;
93
 
DROP DATABASE drizzledump_test;
94
 
Ensure we don't have those tables (verify we restored something)
95
 
SELECT * FROM test.t1;
96
 
ERROR 42S02: Unknown table 'test.t1'
97
 
SELECT * FROM drizzledump_test.t1;
98
 
ERROR 42S02: Unknown table 'drizzledump_test.t1'
99
 
Restoring from dumpfile
100
 
USE test;
101
 
SELECT * FROM t1;
102
 
a       b
103
 
a       100
104
 
b       200
105
 
SELECT * FROM drizzledump_test.t1;
106
 
a       b
107
 
1       abbazabba
108
 
Cleanup
109
 
DROP DATABASE drizzledump_test;
110
 
DROP TABLE t1;
111
 
# End tests
112
 
# Cleanup
113
 
# remove drizzledumpfile