Commit 249927cd authored by unknown's avatar unknown

Merge mysql.com:/home/ram/work/b31070/b31070.5.0

into  mysql.com:/home/ram/work/b31070/b31070.5.1


strings/ctype-big5.c:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
strings/ctype-gb2312.c:
  Auto merged
strings/ctype-sjis.c:
  Auto merged
parents 3b148edb 6dc4dfb3
......@@ -51,6 +51,15 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%';
SELECT c1 as want1result from t1 where c1 like 'location%';
DROP TABLE t1;
#
# Bug #31070: crash during conversion of charsets
#
create table t1 (a set('a') not null);
insert into t1 values (),();
select cast(a as char(1)) from t1;
select a sounds like a from t1;
drop table t1;
DROP DATABASE d1;
# Restore settings
USE test;
......
......@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
......
......@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
......
......@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
......
......@@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
......
......@@ -2587,6 +2587,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning 1364 Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))
select a sounds like a from t1;
a sounds like a
1
1
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
......
......@@ -6272,12 +6272,12 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
{
int hi=s[0];
int hi;
if (s >= e)
return MY_CS_TOOSMALL;
if (hi<0x80)
if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
......
......@@ -8614,12 +8614,12 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi=s[0];
int hi;
if (s >= e)
return MY_CS_TOOSMALL;
if (hi<0x80)
if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
......
......@@ -5664,12 +5664,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
hi=(int) s[0];
if (s >= e)
return MY_CS_TOOSMALL;
if (hi<0x80)
if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
......
......@@ -4527,12 +4527,12 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
static int
my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi=s[0];
int hi;
if (s >= e)
return MY_CS_TOOSMALL;
if (hi < 0x80)
if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment