~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/strict.test

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
440
440
drop table t1;
441
441
 
442
442
 
443
 
# Test INSERT with TINYINT
 
443
# Test INSERT with int
444
444
 
445
 
CREATE TABLE t1(col1 TINYINT, col2 TINYINT UNSIGNED);
 
445
CREATE TABLE t1(col1 int, col2 int UNSIGNED);
446
446
INSERT INTO t1 VALUES(-128,0),(0,0),(127,255),('-128','0'),('0','0'),('127','255'),(-128.0,0.0),(0.0,0.0),(127.0,255.0);
447
447
# Test that we restored the mode checking properly after an ok query
448
448
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
498
498
SELECT * FROM t1;
499
499
DROP TABLE t1;
500
500
 
501
 
# Test INSERT with SMALLINT
 
501
# Test INSERT with int
502
502
 
503
 
CREATE TABLE t1(col1 SMALLINT, col2 SMALLINT UNSIGNED);
 
503
CREATE TABLE t1(col1 int, col2 int UNSIGNED);
504
504
INSERT INTO t1 VALUES(-32768,0),(0,0),(32767,65535),('-32768','0'),('32767','65535'),(-32768.0,0.0),(32767.0,65535.0);
505
505
 
506
506
--error 1264
994
994
--error 1292
995
995
insert into t1 (col2) values (10E+0 + 'a');
996
996
--error 1292
997
 
insert into t1 (col2) values (cast('10a' as unsigned integer));
998
 
insert into t1 (col2) values (cast('10' as unsigned integer));
 
997
insert into t1 (col2) values (cast('10a' as integer));
 
998
insert into t1 (col2) values (cast('10' as integer));
999
999
insert into t1 (col2) values (cast('10' as signed integer));
1000
1000
insert into t1 (col2) values (10E+0 + '0 ');
1001
1001
select * from t1;
1039
1039
#
1040
1040
# Test of inserting an invalid value via a stored procedure (Bug #5907)
1041
1041
#
1042
 
create table t1 (col1 tinyint);
 
1042
create table t1 (col1 int);
1043
1043
drop procedure if exists t1;
1044
1044
delimiter |;
1045
1045
create procedure t1 () begin declare exit handler for sqlexception
1105
1105
 
1106
1106
set @@sql_mode='traditional';
1107
1107
create table t1(a int, b date not null);                                       
1108
 
alter table t1 modify a bigint unsigned not null;
 
1108
alter table t1 modify a bigint not null;
1109
1109
show create table t1;
1110
1110
drop table t1;
1111
1111
 
1169
1169
# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
1170
1170
#
1171
1171
set sql_mode= 'traditional';
1172
 
create table t1(col1 tinyint, col2 tinyint unsigned, 
1173
 
  col3 smallint, col4 smallint unsigned,
1174
 
  col5 mediumint, col6 mediumint unsigned,
1175
 
  col7 int, col8 int unsigned,
1176
 
  col9 bigint, col10 bigint unsigned);
 
1172
create table t1(col1 int, col2 int, 
 
1173
  col3 int, col4 int,
 
1174
  col5 mediumint, col6 mediumint,
 
1175
  col7 int, col8 int,
 
1176
  col9 bigint, col10 bigint);
1177
1177
--error 1366
1178
1178
insert into t1(col1) values('-');
1179
1179
--error 1366