~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/mysql.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:
18
18
a
19
19
1
20
20
drop table t1;
 
21
create table t1(a int);
 
22
lock tables t1 write;
 
23
database()
 
24
test
 
25
unlock tables;
 
26
drop table t1;
21
27
+-------------------+
22
28
| __tañgè Ñãmé      |
23
29
+-------------------+
39
45
+------+------+---------------------------+
40
46
i       j       k
41
47
NULL    1       NULL
42
 
Field   Type    Null    Default Default_is_NULL On_Update
43
 
i       INTEGER YES             YES     
44
 
j       INTEGER NO              NO      
45
 
k       INTEGER YES             YES     
 
48
Field   Type    Null    Key     Default Extra
 
49
i       int     YES             NULL    
 
50
j       int     NO              NULL    
 
51
k       int     YES             NULL    
46
52
+------+---+------+
47
53
| i    | j | k    |
48
54
+------+---+------+
49
55
| NULL | 1 | NULL | 
50
56
+------+---+------+
51
 
+-------+---------+------+---------+-----------------+-----------+
52
 
| Field | Type    | Null | Default | Default_is_NULL | On_Update |
53
 
+-------+---------+------+---------+-----------------+-----------+
54
 
| i     | INTEGER | YES  |         | YES             |           | 
55
 
| j     | INTEGER | NO   |         | NO              |           | 
56
 
| k     | INTEGER | YES  |         | YES             |           | 
57
 
+-------+---------+------+---------+-----------------+-----------+
 
57
+-------+------+------+-----+---------+-------+
 
58
| Field | Type | Null | Key | Default | Extra |
 
59
+-------+------+------+-----+---------+-------+
 
60
| i     | int  | YES  |     | NULL    |       | 
 
61
| j     | int  | NO   |     | NULL    |       | 
 
62
| k     | int  | YES  |     | NULL    |       | 
 
63
+-------+------+------+-----+---------+-------+
58
64
i       s1
59
65
1       x
60
66
2       NULL
74
80
| NULL        | 
75
81
+-------------+
76
82
create table t1(a int, b varchar(255), c int);
77
 
Field   Type    Null    Default Default_is_NULL On_Update
78
 
a       INTEGER YES             YES     
79
 
b       VARCHAR YES             YES     
80
 
c       INTEGER YES             YES     
81
 
Field   Type    Null    Default Default_is_NULL On_Update
82
 
a       INTEGER YES             YES     
83
 
b       VARCHAR YES             YES     
84
 
c       INTEGER YES             YES     
 
83
Field   Type    Null    Key     Default Extra
 
84
a       int     YES             NULL    
 
85
b       varchar(255)    YES             NULL    
 
86
c       int     YES             NULL    
 
87
Field   Type    Null    Key     Default Extra
 
88
a       int     YES             NULL    
 
89
b       varchar(255)    YES             NULL    
 
90
c       int     YES             NULL    
85
91
drop table t1;
86
92
1
87
93
1
88
94
ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '' at line 1
89
 
ERROR: USE must be followed by a schema name
 
95
ERROR: USE must be followed by a database name
90
96
create table t17583 (a int);
91
97
insert into t17583 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
92
98
insert into t17583 select a from t17583;
104
110
Test connect with dbname only => new dbname, old hostname
105
111
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'connecttest' at line 1
106
112
Test connect with _invalid_ dbname only => new invalid dbname, old hostname
107
 
ERROR 1049 (42000): Unknown schema 'invalid'
108
 
ERROR 1049 (42000): Unknown schema 'invalid'
 
113
ERROR 1049 (42000): Unknown database 'invalid'
 
114
ERROR 1049 (42000): Unknown database 'invalid'
109
115
Test connect with dbname + hostname
110
116
Test connect with dbname + _invalid_ hostname
111
117
End of 5.0 tests