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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2e2c5a20
Commit
2e2c5a20
authored
Sep 20, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
20b3e8a2
d9576364
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
7 deletions
+76
-7
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+21
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+21
-0
sql/field.h
sql/field.h
+2
-0
sql/unireg.cc
sql/unireg.cc
+32
-7
No files found.
mysql-test/r/ctype_ucs.result
View file @
2e2c5a20
...
...
@@ -755,6 +755,27 @@ select export_set(5, name, upper(name), ",", 5) from bug20536;
export_set(5, name, upper(name), ",", 5)
test1,TEST1,test1,TEST1,TEST1
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
CREATE TABLE t1 (
status enum('active','passive') collate latin1_general_ci
NOT NULL default 'passive'
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`status` enum('active','passive') character set latin1 collate latin1_general_ci NOT NULL default 'passive'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 ADD a int NOT NULL AFTER status;
CREATE TABLE t2 (
status enum('active','passive') collate ucs2_turkish_ci
NOT NULL default 'passive'
);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`status` enum('active','passive') character set ucs2 collate ucs2_turkish_ci NOT NULL default 'passive'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t2 ADD a int NOT NULL AFTER status;
DROP TABLE t1,t2;
select password(name) from bug20536;
password(name)
????????????????????
...
...
mysql-test/t/ctype_ucs.test
View file @
2e2c5a20
...
...
@@ -484,6 +484,27 @@ select make_set(3, name, upper(name)) from bug20536;
select
export_set
(
5
,
name
,
upper
(
name
))
from
bug20536
;
select
export_set
(
5
,
name
,
upper
(
name
),
","
,
5
)
from
bug20536
;
#
# Bug #20108: corrupted default enum value for a ucs2 field
#
CREATE
TABLE
t1
(
status
enum
(
'active'
,
'passive'
)
collate
latin1_general_ci
NOT
NULL
default
'passive'
);
SHOW
CREATE
TABLE
t1
;
ALTER
TABLE
t1
ADD
a
int
NOT
NULL
AFTER
status
;
CREATE
TABLE
t2
(
status
enum
(
'active'
,
'passive'
)
collate
ucs2_turkish_ci
NOT
NULL
default
'passive'
);
SHOW
CREATE
TABLE
t2
;
ALTER
TABLE
t2
ADD
a
int
NOT
NULL
AFTER
status
;
DROP
TABLE
t1
,
t2
;
# Some broken functions: add these tests just to document current behavior.
# PASSWORD and OLD_PASSWORD don't work with UCS2 strings, but to fix it would
...
...
sql/field.h
View file @
2e2c5a20
...
...
@@ -1432,6 +1432,8 @@ class create_field :public Sql_alloc
uint
decimals
,
flags
,
pack_length
,
key_length
;
Field
::
utype
unireg_check
;
TYPELIB
*
interval
;
// Which interval to use
TYPELIB
*
save_interval
;
// Temporary copy for the above
// Used only for UCS2 intervals
List
<
String
>
interval_list
;
CHARSET_INFO
*
charset
;
Field
::
geometry_type
geom_type
;
...
...
sql/unireg.cc
View file @
2e2c5a20
...
...
@@ -228,13 +228,19 @@ bool mysql_create_frm(THD *thd, my_string file_name,
goto
err3
;
{
/* Unescape all UCS2 intervals: were escaped in pack_headers */
/*
Restore all UCS2 intervals.
HEX representation of them is not needed anymore.
*/
List_iterator
<
create_field
>
it
(
create_fields
);
create_field
*
field
;
while
((
field
=
it
++
))
{
if
(
field
->
interval
&&
field
->
charset
->
mbminlen
>
1
)
unhex_type2
(
field
->
interval
);
if
(
field
->
save_interval
)
{
field
->
interval
=
field
->
save_interval
;
field
->
save_interval
=
0
;
}
}
}
DBUG_RETURN
(
0
);
...
...
@@ -514,18 +520,36 @@ static bool pack_header(uchar *forminfo, enum db_type table_type,
reclength
=
(
uint
)
(
field
->
offset
+
data_offset
+
length
);
n_length
+=
(
ulong
)
strlen
(
field
->
field_name
)
+
1
;
field
->
interval_id
=
0
;
field
->
save_interval
=
0
;
if
(
field
->
interval
)
{
uint
old_int_count
=
int_count
;
if
(
field
->
charset
->
mbminlen
>
1
)
{
/* Escape UCS2 intervals using HEX notation */
/*
Escape UCS2 intervals using HEX notation to avoid
problems with delimiters between enum elements.
As the original representation is still needed in
the function make_empty_rec to create a record of
filled with default values it is saved in save_interval
The HEX representation is created from this copy.
*/
field
->
save_interval
=
field
->
interval
;
field
->
interval
=
(
TYPELIB
*
)
sql_alloc
(
sizeof
(
TYPELIB
));
*
field
->
interval
=
*
field
->
save_interval
;
field
->
interval
->
type_names
=
(
const
char
**
)
sql_alloc
(
sizeof
(
char
*
)
*
(
field
->
interval
->
count
+
1
));
field
->
interval
->
type_names
[
field
->
interval
->
count
]
=
0
;
field
->
interval
->
type_lengths
=
(
uint
*
)
sql_alloc
(
sizeof
(
uint
)
*
field
->
interval
->
count
);
for
(
uint
pos
=
0
;
pos
<
field
->
interval
->
count
;
pos
++
)
{
char
*
dst
;
uint
length
=
field
->
interval
->
type_lengths
[
pos
],
hex_length
;
const
char
*
src
=
field
->
interval
->
type_names
[
pos
];
uint
length
=
field
->
save_
interval
->
type_lengths
[
pos
],
hex_length
;
const
char
*
src
=
field
->
save_
interval
->
type_names
[
pos
];
hex_length
=
length
*
2
;
field
->
interval
->
type_lengths
[
pos
]
=
hex_length
;
field
->
interval
->
type_names
[
pos
]
=
dst
=
sql_alloc
(
hex_length
+
1
);
...
...
@@ -777,7 +801,8 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type,
field
->
charset
,
field
->
geom_type
,
field
->
unireg_check
,
field
->
interval
,
field
->
save_interval
?
field
->
save_interval
:
field
->
interval
,
field
->
field_name
,
&
table
);
if
(
!
regfield
)
...
...
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