~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_test.test

  • Committer: Brian Aker
  • Date: 2010-10-06 07:52:09 UTC
  • mto: (1821.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1822.
  • Revision ID: brian@tangent.org-20101006075209-0fu3u7zg9r8rw3i8
Fix issue with divide by zero not being an error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
# Bug#23411: The "%" (MOD) operator is not documented; MOD-ing zero returns strange result
70
70
# Manual: "Division by zero produces a NULL result"
71
71
#
 
72
--error ER_DIVISION_BY_ZERO
72
73
select (12%0) <=> null      as '1';
 
74
--error ER_DIVISION_BY_ZERO
73
75
select (12%0) is null       as '1';
 
76
--error ER_DIVISION_BY_ZERO
74
77
select 12%0                 as 'NULL';
75
78
select 12%2                 as '0';
76
79
select 12%NULL              as 'NULL';
80
83
select 0 % null             as 'NULL';
81
84
select null % null          as 'NULL';
82
85
 
 
86
--error ER_DIVISION_BY_ZERO
83
87
select (12 mod 0) <=> null  as '1';
 
88
--error ER_DIVISION_BY_ZERO
84
89
select (12 mod 0) is null   as '1';
 
90
--error ER_DIVISION_BY_ZERO
85
91
select 12 mod 0             as 'NULL';
86
92
select 12 mod 2             as '0';
87
93
select 12 mod null          as 'NULL';
90
96
select 0 mod null           as 'NULL';
91
97
select null mod null        as 'NULL';
92
98
 
 
99
--error ER_DIVISION_BY_ZERO
93
100
select mod(12.0, 0)         as 'NULL';
 
101
--error ER_DIVISION_BY_ZERO
94
102
select mod(12, 0.0)         as 'NULL';
95
103
select mod(12, NULL)        as 'NULL';
96
104
select mod(12.0, NULL)      as 'NULL';