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
0137c812
Commit
0137c812
authored
Mar 18, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SHOW CREATE TABLE didn't display field names in the proper charset
parent
7549a76c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
2 deletions
+104
-2
mysql-test/r/ctype_recoding.result
mysql-test/r/ctype_recoding.result
+43
-0
mysql-test/t/ctype_recoding.test
mysql-test/t/ctype_recoding.test
+28
-0
mysys/charset.c
mysys/charset.c
+2
-0
sql/sql_show.cc
sql/sql_show.cc
+2
-2
sql/sql_string.cc
sql/sql_string.cc
+28
-0
sql/sql_string.h
sql/sql_string.h
+1
-0
No files found.
mysql-test/r/ctype_recoding.result
0 → 100644
View file @
0137c812
SET NAMES koi8r;
DROP TABLE IF EXISTS ;
CREATE TABLE
(
CHAR(32) CHARACTER SET koi8r NOT NULL
);
SHOW TABLES;
Tables_in_test
SHOW CREATE TABLE ;
Table Create Table
CREATE TABLE `` (
`` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
SHOW FIELDS FROM ;
Field Type Collation Null Key Default Extra
char(32) character set koi8r koi8r
SET NAMES cp1251;
SHOW TABLES;
Tables_in_test
SHOW CREATE TABLE ;
Table Create Table
CREATE TABLE `` (
`` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
SHOW FIELDS FROM ;
Field Type Collation Null Key Default Extra
char(32) character set koi8r koi8r
SET NAMES utf8;
SHOW TABLES;
Tables_in_test
таблица
SHOW CREATE TABLE таблица;
Table Create Table
таблица CREATE TABLE `таблица` (
`поле` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
SHOW FIELDS FROM таблица;
Field Type Collation Null Key Default Extra
поле char(32) character set koi8r koi8r
SET NAMES koi8r;
DROP TABLE ;
mysql-test/t/ctype_recoding.test
0 → 100644
View file @
0137c812
SET
NAMES
koi8r
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
;
--
enable_warnings
CREATE
TABLE
(
CHAR
(
32
)
CHARACTER
SET
koi8r
NOT
NULL
);
SHOW
TABLES
;
SHOW
CREATE
TABLE
;
SHOW
FIELDS
FROM
;
SET
NAMES
cp1251
;
SHOW
TABLES
;
SHOW
CREATE
TABLE
;
SHOW
FIELDS
FROM
;
SET
NAMES
utf8
;
SHOW
TABLES
;
SHOW
CREATE
TABLE
таблица
;
SHOW
FIELDS
FROM
таблица
;
SET
NAMES
koi8r
;
DROP
TABLE
;
mysys/charset.c
View file @
0137c812
...
...
@@ -341,6 +341,8 @@ static int add_collation(CHARSET_INFO *cs)
all_charsets
[
cs
->
number
]
->
state
|=
cs
->
state
;
}
cs
->
number
=
0
;
cs
->
primary_number
=
0
;
cs
->
binary_number
=
0
;
cs
->
name
=
NULL
;
cs
->
state
=
0
;
cs
->
sort_order
=
NULL
;
...
...
sql/sql_show.cc
View file @
0137c812
...
...
@@ -1014,12 +1014,12 @@ append_identifier(THD *thd, String *packet, const char *name)
if
(
thd
->
options
&
OPTION_QUOTE_SHOW_CREATE
)
{
packet
->
append
(
&
qtype
,
1
);
packet
->
append
(
name
);
packet
->
append
(
name
,
0
,
system_charset_info
);
packet
->
append
(
&
qtype
,
1
);
}
else
{
packet
->
append
(
name
);
packet
->
append
(
name
,
0
,
system_charset_info
);
}
}
...
...
sql/sql_string.cc
View file @
0137c812
...
...
@@ -338,6 +338,34 @@ bool String::append(const char *s,uint32 arg_length)
}
/*
Append a string in the given charset to the string
with character set recoding
*/
bool
String
::
append
(
const
char
*
s
,
uint32
arg_length
,
CHARSET_INFO
*
cs
)
{
if
(
!
arg_length
)
// Default argument
if
(
!
(
arg_length
=
(
uint32
)
strlen
(
s
)))
return
FALSE
;
if
(
str_charset
->
mbmaxlen
>
1
)
{
uint32
add_length
=
arg_length
*
str_charset
->
mbmaxlen
;
if
(
realloc
(
str_length
+
add_length
))
return
TRUE
;
str_length
+=
copy_and_convert
(
Ptr
+
str_length
,
add_length
,
str_charset
,
s
,
arg_length
,
cs
);
return
FALSE
;
}
if
(
realloc
(
str_length
+
arg_length
))
return
TRUE
;
memcpy
(
Ptr
+
str_length
,
s
,
arg_length
);
str_length
+=
arg_length
;
return
FALSE
;
}
#ifdef TO_BE_REMOVED
bool
String
::
append
(
FILE
*
file
,
uint32
arg_length
,
myf
my_flags
)
{
...
...
sql/sql_string.h
View file @
0137c812
...
...
@@ -181,6 +181,7 @@ class String
CHARSET_INFO
*
csto
);
bool
append
(
const
String
&
s
);
bool
append
(
const
char
*
s
,
uint32
arg_length
=
0
);
bool
append
(
const
char
*
s
,
uint32
arg_length
,
CHARSET_INFO
*
cs
);
bool
append
(
IO_CACHE
*
file
,
uint32
arg_length
);
int
strstr
(
const
String
&
search
,
uint32
offset
=
0
);
// Returns offset to substring or -1
int
strstr_case
(
const
String
&
s
,
uint32
offset
=
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