3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # Tests to verify that arithmetic operators do not change the type of
13 # input operands. Ticket [a8a0d2996a]
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix tkt-a8a0d2996a
22 INSERT INTO t VALUES('1','1');
23 SELECT typeof(x), typeof(y) FROM t WHERE 1=x+0 AND y=='1';
26 SELECT typeof(x), typeof(y) FROM t WHERE 1=x-0 AND y=='1';
29 SELECT typeof(x), typeof(y) FROM t WHERE 1=x*1 AND y=='1';
32 SELECT typeof(x), typeof(y) FROM t WHERE 1=x/1 AND y=='1';
35 SELECT typeof(x), typeof(y) FROM t WHERE 1=x%4 AND y=='1';
39 UPDATE t SET x='1xyzzy';
40 SELECT typeof(x), typeof(y) FROM t WHERE 1=x+0 AND y=='1';
43 SELECT typeof(x), typeof(y) FROM t WHERE 1=x-0 AND y=='1';
46 SELECT typeof(x), typeof(y) FROM t WHERE 1=x*1 AND y=='1';
49 SELECT typeof(x), typeof(y) FROM t WHERE 1=x/1 AND y=='1';
52 SELECT typeof(x), typeof(y) FROM t WHERE 1=x%4 AND y=='1';
58 SELECT typeof(x), typeof(y) FROM t WHERE 1=x+0 AND y=='1';
61 SELECT typeof(x), typeof(y) FROM t WHERE 1=x-0 AND y=='1';
64 SELECT typeof(x), typeof(y) FROM t WHERE 1=x*1 AND y=='1';
67 SELECT typeof(x), typeof(y) FROM t WHERE 1=x/1 AND y=='1';
70 SELECT typeof(x), typeof(y) FROM t WHERE 1=x%4 AND y=='1';
77 SELECT '1.23e64'/'1.0000e+62';
86 SELECT '-9223372036854775807x'-'1x';
87 } {-9223372036854775808}
89 SELECT '9223372036854775806x'+'1x';
90 } {9223372036854775807}
92 SELECT '1234x'/'10y', '1234x'/'10.y', '1234x'/'1e1y';