Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
da0a0ad2
Commit
da0a0ad2
authored
Nov 09, 2006
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/home/bar/mysql-5.0.b21505
into mysql.com:/usr/home/bar/mysql-5.1.b21505
parents
41a324ea
aa1c8a58
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
14 deletions
+74
-14
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+26
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+24
-0
sql/field.cc
sql/field.cc
+1
-0
sql/field.h
sql/field.h
+7
-0
sql/item.cc
sql/item.cc
+1
-1
sql/item.h
sql/item.h
+0
-12
sql/mysql_priv.h
sql/mysql_priv.h
+11
-0
sql/sql_select.cc
sql/sql_select.cc
+4
-1
No files found.
mysql-test/r/ctype_utf8.result
View file @
da0a0ad2
...
@@ -1536,6 +1536,32 @@ set @a:=null;
...
@@ -1536,6 +1536,32 @@ set @a:=null;
execute my_stmt using @a;
execute my_stmt using @a;
a b
a b
drop table if exists t1;
drop table if exists t1;
drop table if exists t1;
drop view if exists v1, v2;
set names utf8;
create table t1(col1 varchar(12) character set utf8 collate utf8_unicode_ci);
insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
4 utf8_general_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)
2 utf8_unicode_ci
2 utf8_unicode_ci
drop view v1, v2;
create view v1 as select 'v1_val' collate utf8_swedish_ci as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
0 utf8_swedish_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1) from v2;
coercibility(col1) collation(col1)
0 utf8_swedish_ci
0 utf8_swedish_ci
drop view v1, v2;
drop table t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
colA int(11) NOT NULL,
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
...
...
mysql-test/t/ctype_utf8.test
View file @
da0a0ad2
...
@@ -1229,6 +1229,30 @@ set @a:=null;
...
@@ -1229,6 +1229,30 @@ set @a:=null;
execute
my_stmt
using
@
a
;
execute
my_stmt
using
@
a
;
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
#
# Bug#21505 Create view - illegal mix of collation for operation 'UNION'
#
--
disable_warnings
drop
table
if
exists
t1
;
drop
view
if
exists
v1
,
v2
;
--
enable_warnings
set
names
utf8
;
create
table
t1
(
col1
varchar
(
12
)
character
set
utf8
collate
utf8_unicode_ci
);
insert
into
t1
values
(
't1_val'
);
create
view
v1
as
select
'v1_val'
as
col1
;
select
coercibility
(
col1
),
collation
(
col1
)
from
v1
;
create
view
v2
as
select
col1
from
v1
union
select
col1
from
t1
;
select
coercibility
(
col1
),
collation
(
col1
)
from
v2
;
drop
view
v1
,
v2
;
create
view
v1
as
select
'v1_val'
collate
utf8_swedish_ci
as
col1
;
select
coercibility
(
col1
),
collation
(
col1
)
from
v1
;
create
view
v2
as
select
col1
from
v1
union
select
col1
from
t1
;
select
coercibility
(
col1
),
collation
(
col1
)
from
v2
;
drop
view
v1
,
v2
;
drop
table
t1
;
#
#
# Bug#19960: Inconsistent results when joining
# Bug#19960: Inconsistent results when joining
# InnoDB tables using partial UTF8 indexes
# InnoDB tables using partial UTF8 indexes
...
...
sql/field.cc
View file @
da0a0ad2
...
@@ -1427,6 +1427,7 @@ Field_str::Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
...
@@ -1427,6 +1427,7 @@ Field_str::Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
field_charset
=
charset
;
field_charset
=
charset
;
if
(
charset
->
state
&
MY_CS_BINSORT
)
if
(
charset
->
state
&
MY_CS_BINSORT
)
flags
|=
BINARY_FLAG
;
flags
|=
BINARY_FLAG
;
field_derivation
=
DERIVATION_IMPLICIT
;
}
}
...
...
sql/field.h
View file @
da0a0ad2
...
@@ -351,6 +351,9 @@ public:
...
@@ -351,6 +351,9 @@ public:
virtual
CHARSET_INFO
*
sort_charset
(
void
)
const
{
return
charset
();
}
virtual
CHARSET_INFO
*
sort_charset
(
void
)
const
{
return
charset
();
}
virtual
bool
has_charset
(
void
)
const
{
return
FALSE
;
}
virtual
bool
has_charset
(
void
)
const
{
return
FALSE
;
}
virtual
void
set_charset
(
CHARSET_INFO
*
charset
)
{
}
virtual
void
set_charset
(
CHARSET_INFO
*
charset
)
{
}
virtual
enum
Derivation
derivation
(
void
)
const
{
return
DERIVATION_IMPLICIT
;
}
virtual
void
set_derivation
(
enum
Derivation
derivation
)
{
}
bool
set_warning
(
MYSQL_ERROR
::
enum_warning_level
,
unsigned
int
code
,
bool
set_warning
(
MYSQL_ERROR
::
enum_warning_level
,
unsigned
int
code
,
int
cuted_increment
);
int
cuted_increment
);
bool
check_int
(
const
char
*
str
,
int
length
,
const
char
*
int_end
,
bool
check_int
(
const
char
*
str
,
int
length
,
const
char
*
int_end
,
...
@@ -446,6 +449,7 @@ public:
...
@@ -446,6 +449,7 @@ public:
class
Field_str
:
public
Field
{
class
Field_str
:
public
Field
{
protected:
protected:
CHARSET_INFO
*
field_charset
;
CHARSET_INFO
*
field_charset
;
enum
Derivation
field_derivation
;
public:
public:
Field_str
(
char
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
Field_str
(
char
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
utype
unireg_check_arg
,
uchar
null_bit_arg
,
utype
unireg_check_arg
,
...
@@ -459,6 +463,9 @@ public:
...
@@ -459,6 +463,9 @@ public:
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
CHARSET_INFO
*
charset
(
void
)
const
{
return
field_charset
;
}
CHARSET_INFO
*
charset
(
void
)
const
{
return
field_charset
;
}
void
set_charset
(
CHARSET_INFO
*
charset
)
{
field_charset
=
charset
;
}
void
set_charset
(
CHARSET_INFO
*
charset
)
{
field_charset
=
charset
;
}
enum
Derivation
derivation
(
void
)
const
{
return
field_derivation
;
}
virtual
void
set_derivation
(
enum
Derivation
derivation_arg
)
{
field_derivation
=
derivation_arg
;
}
bool
binary
()
const
{
return
field_charset
==
&
my_charset_bin
;
}
bool
binary
()
const
{
return
field_charset
==
&
my_charset_bin
;
}
uint32
max_length
()
{
return
field_length
;
}
uint32
max_length
()
{
return
field_length
;
}
friend
class
create_field
;
friend
class
create_field
;
...
...
sql/item.cc
View file @
da0a0ad2
...
@@ -1655,7 +1655,7 @@ void Item_field::set_field(Field *field_par)
...
@@ -1655,7 +1655,7 @@ void Item_field::set_field(Field *field_par)
db_name
=
field_par
->
table
->
s
->
db
.
str
;
db_name
=
field_par
->
table
->
s
->
db
.
str
;
alias_name_used
=
field_par
->
table
->
alias_name_used
;
alias_name_used
=
field_par
->
table
->
alias_name_used
;
unsigned_flag
=
test
(
field_par
->
flags
&
UNSIGNED_FLAG
);
unsigned_flag
=
test
(
field_par
->
flags
&
UNSIGNED_FLAG
);
collation
.
set
(
field_par
->
charset
(),
DERIVATION_IMPLICIT
);
collation
.
set
(
field_par
->
charset
(),
field_par
->
derivation
()
);
fixed
=
1
;
fixed
=
1
;
}
}
...
...
sql/item.h
View file @
da0a0ad2
...
@@ -27,19 +27,7 @@ class Item_field;
...
@@ -27,19 +27,7 @@ class Item_field;
/*
/*
"Declared Type Collation"
"Declared Type Collation"
A combination of collation and its derivation.
A combination of collation and its derivation.
*/
enum
Derivation
{
DERIVATION_IGNORABLE
=
5
,
DERIVATION_COERCIBLE
=
4
,
DERIVATION_SYSCONST
=
3
,
DERIVATION_IMPLICIT
=
2
,
DERIVATION_NONE
=
1
,
DERIVATION_EXPLICIT
=
0
};
/*
Flags for collation aggregation modes:
Flags for collation aggregation modes:
MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset
MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset
MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value
MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value
...
...
sql/mysql_priv.h
View file @
da0a0ad2
...
@@ -105,6 +105,17 @@ extern CHARSET_INFO *system_charset_info, *files_charset_info ;
...
@@ -105,6 +105,17 @@ extern CHARSET_INFO *system_charset_info, *files_charset_info ;
extern
CHARSET_INFO
*
national_charset_info
,
*
table_alias_charset
;
extern
CHARSET_INFO
*
national_charset_info
,
*
table_alias_charset
;
enum
Derivation
{
DERIVATION_IGNORABLE
=
5
,
DERIVATION_COERCIBLE
=
4
,
DERIVATION_SYSCONST
=
3
,
DERIVATION_IMPLICIT
=
2
,
DERIVATION_NONE
=
1
,
DERIVATION_EXPLICIT
=
0
};
typedef
struct
my_locale_st
typedef
struct
my_locale_st
{
{
const
char
*
name
;
const
char
*
name
;
...
...
sql/sql_select.cc
View file @
da0a0ad2
...
@@ -8723,6 +8723,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -8723,6 +8723,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item
->
collation
.
collation
);
item
->
collation
.
collation
);
else
else
new_field
=
item
->
make_string_field
(
table
);
new_field
=
item
->
make_string_field
(
table
);
new_field
->
set_derivation
(
item
->
collation
.
derivation
);
break
;
break
;
case
DECIMAL_RESULT
:
case
DECIMAL_RESULT
:
new_field
=
new
Field_new_decimal
(
item
->
max_length
,
maybe_null
,
item
->
name
,
new_field
=
new
Field_new_decimal
(
item
->
max_length
,
maybe_null
,
item
->
name
,
...
@@ -8908,7 +8909,9 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -8908,7 +8909,9 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
(
make_copy_field
?
0
:
copy_func
),
(
make_copy_field
?
0
:
copy_func
),
modify_item
,
convert_blob_length
);
modify_item
,
convert_blob_length
);
case
Item
:
:
TYPE_HOLDER
:
case
Item
:
:
TYPE_HOLDER
:
return
((
Item_type_holder
*
)
item
)
->
make_field_by_type
(
table
);
result
=
((
Item_type_holder
*
)
item
)
->
make_field_by_type
(
table
);
result
->
set_derivation
(
item
->
collation
.
derivation
);
return
result
;
default:
// Dosen't have to be stored
default:
// Dosen't have to be stored
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment