~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1 (sint8 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('127.4');
INSERT INTO t1 VALUES ('127.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('-127.4');
INSERT INTO t1 VALUES ('-127.5');
INSERT INTO t1 VALUES ('-128.4');
INSERT INTO t1 VALUES ('-128.5');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (uint8 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('127.4');
INSERT INTO t1 VALUES ('127.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('255.4');
INSERT INTO t1 VALUES ('255.5');
SELECT * FROM t1;
DROP TABLE t1;


CREATE TABLE t1 (sint16 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('32767.4');
INSERT INTO t1 VALUES ('32767.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('-32767.4');
INSERT INTO t1 VALUES ('-32767.5');
INSERT INTO t1 VALUES ('-32768.4');
INSERT INTO t1 VALUES ('-32768.5');
SELECT * FROM t1;
DROP TABLE t1;


CREATE TABLE t1 (uint16 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('32767.4');
INSERT INTO t1 VALUES ('32767.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('65535.4');
INSERT INTO t1 VALUES ('65535.5');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (sint24 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('8388607.4');
INSERT INTO t1 VALUES ('8388607.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('-8388607.4');
INSERT INTO t1 VALUES ('-8388607.5');
INSERT INTO t1 VALUES ('-8388608.4');
INSERT INTO t1 VALUES ('-8388608.5');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (uint24 int not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('8388607.4');
INSERT INTO t1 VALUES ('8388607.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('16777215.4');
INSERT INTO t1 VALUES ('16777215.5');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (sint64 bigint not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('9223372036854775807.4');
INSERT INTO t1 VALUES ('9223372036854775806.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
INSERT INTO t1 VALUES ('-9223372036854775807.4');
INSERT INTO t1 VALUES ('-9223372036854775807.5');
INSERT INTO t1 VALUES ('-9223372036854775808.4');
INSERT INTO t1 VALUES ('-9223372036854775802.5');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (uint64 bigint not null);
INSERT INTO t1 VALUES ('0.1');
INSERT INTO t1 VALUES ('0.5');
INSERT INTO t1 VALUES ('9223372036854775807.4');
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t1 VALUES ('9223372036854775807.5');
INSERT INTO t1 VALUES ('-0.1');
INSERT INTO t1 VALUES ('-0.5');
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t1 VALUES ('18446744073709551615.4');
SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (str varchar(128), sint64 bigint not null default 0);
INSERT INTO t1 (str) VALUES ('1.5');
INSERT INTO t1 (str) VALUES ('1.00005e4');
INSERT INTO t1 (str) VALUES ('1.0005e3');
INSERT INTO t1 (str) VALUES ('1.005e2');
INSERT INTO t1 (str) VALUES ('1.05e1');
INSERT INTO t1 (str) VALUES ('1.5e0');
INSERT INTO t1 (str) VALUES ('100005e-1');
INSERT INTO t1 (str) VALUES ('100050e-2');
INSERT INTO t1 (str) VALUES ('100500e-3');
INSERT INTO t1 (str) VALUES ('105000e-4');
INSERT INTO t1 (str) VALUES ('150000e-5');
UPDATE t1 SET sint64=str;
SELECT * FROM t1;
DROP TABLE t1;