~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/cast.test

  • Committer: Stewart Smith
  • Date: 2009-03-04 22:49:53 UTC
  • mto: (910.4.2 sparc) (908.3.6 work)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: stewart@flamingspork.com-20090304224953-b2ow237kc1bkp0o0
for getopt, replace GET_ULONG with GET_UINT32.

Don't replace for sql variables (yet). instead just indicated the intense source of fail with GET_ULONG_IS_FAIL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
select cast(1000 as CHAR(3));
38
38
 
39
39
# Should throw an error about 'abc' being too large for a char(2)
40
 
--error ER_TRUNCATED_WRONG_VALUE
 
40
--error 1292
41
41
create table t1 select
42
42
  cast('ab'  AS char)    as c1,
43
43
  cast('a '  AS char)    as c2,
45
45
  cast('a  ' AS char(2)) as c4,
46
46
  cast('a'   AS char(2)) as c5;
47
47
 
48
 
##
49
 
## CAST to NCHAR with/without length
50
 
##
51
 
#select
52
 
#  cast('��'  AS char)    as c1,
53
 
#  cast('� '  AS char)    as c2,
54
 
#  cast('���' AS char(2)) as c3,
55
 
#  cast('�  ' AS char(2)) as c4,
56
 
#  cast('�'   AS char(2)) as c5;
 
48
#
 
49
# CAST to NCHAR with/without length
 
50
#
 
51
select
 
52
  cast('��'  AS char)    as c1,
 
53
  cast('� '  AS char)    as c2,
 
54
  cast('���' AS char(2)) as c3,
 
55
  cast('�  ' AS char(2)) as c4,
 
56
  cast('�'   AS char(2)) as c5;
57
57
 
58
58
# BUG in drizzletest - can't handle these chars right
59
59
# # Should throw an error about incorrect
60
 
#--error ER_TRUNCATED_WRONG_VALUE
 
60
#--error 1292
61
61
#create table t1 select
62
62
#  cast('��'  AS char)    as c1,
63
63
#  cast('� '  AS char)    as c2,
129
129
#
130
130
# Bug #17903: cast to char results in binary
131
131
#
 
132
select hex(cast('a' as char(2) binary));
132
133
select hex(cast('a' as binary(2)));
 
134
select hex(cast('a' as char(2) binary));
133
135
 
134
136
 
135
137
#