2 Sybase-CT bug #29064 (Exact numeric/decimal/money datatypes lose precision)
4 <?php require('skipif.inc'); ?>
7 /* This file is part of PHP test framework for ext/sybase_ct
14 $db= sybase_connect_ex();
16 // Create a temporary table and fill it with test values
17 var_dump(sybase_query('
19 test_decimal decimal(38, 6) null,
20 test_numeric numeric(38, 12) null,
21 test_money money null,
22 test_bigint decimal(38, 0) null,
24 test_smallmoney smallmoney null,
25 test_smallint smallint null,
26 test_tinyint tinyint null,
28 test_double float null
31 var_dump(sybase_query('
44 12345678901234567890123456789012.123456,
45 12345678901234567890123456.123456789012,
47 12345678901234567890123456789012345678,
56 var_dump(sybase_query('
69 -12345678901234567890123456789012.123456,
70 -12345678901234567890123456.123456789012,
71 -123456789012345.1234,
72 -12345678901234567890123456789012345678,
83 var_dump(sybase_select_ex($db, 'select * from #test'));
85 // Clean up and close connection
86 var_dump(sybase_query('drop table #test', $db));
93 >>> Query: select * from #test
99 string(39) "12345678901234567890123456789012.123456"
101 string(39) "12345678901234567890123456.123456789012"
103 string(18) "123456789012345.12"
105 string(38) "12345678901234567890123456789012345678"
108 ["test_smallmoney"]=>
115 string(18) "123456789.12345679"
117 string(18) "123456789.12345679"
122 string(40) "-12345678901234567890123456789012.123456"
124 string(40) "-12345678901234567890123456.123456789012"
126 string(19) "-123456789012345.12"
128 string(39) "-12345678901234567890123456789012345678"
131 ["test_smallmoney"]=>
138 string(19) "-123456789.12345679"
140 string(19) "-123456789.12345679"