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
8bbb6d2b
Commit
8bbb6d2b
authored
Mar 19, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #2821 Table default character set affects LONGBLOB fields
parent
bf4e1d46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+16
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+11
-0
sql/sql_table.cc
sql/sql_table.cc
+4
-2
No files found.
mysql-test/r/alter_table.result
View file @
8bbb6d2b
...
...
@@ -343,6 +343,22 @@ t1 CREATE TABLE `t1` (
`a` char(10) character set latin1 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
drop table t1;
create table t1 (myblob longblob,mytext longtext)
default charset latin1 collate latin1_general_cs;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`myblob` longblob,
`mytext` longtext character set latin1 collate latin1_general_cs
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 character set latin2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`myblob` longblob,
`mytext` longtext character set latin2
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 (
Host varchar(16) binary NOT NULL default '',
User varchar(16) binary NOT NULL default '',
...
...
mysql-test/t/alter_table.test
View file @
8bbb6d2b
...
...
@@ -183,6 +183,17 @@ show create table t1;
drop
table
t1
;
#
# Bug#2821
# Test that table CHARACTER SET does not affect blobs
#
create
table
t1
(
myblob
longblob
,
mytext
longtext
)
default
charset
latin1
collate
latin1_general_cs
;
show
create
table
t1
;
alter
table
t1
character
set
latin2
;
show
create
table
t1
;
drop
table
t1
;
#
# Test ALTER TABLE ENABLE/DISABLE keys when things are locked
#
...
...
sql/sql_table.cc
View file @
8bbb6d2b
...
...
@@ -470,9 +470,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field
->
charset
=
create_info
->
default_table_charset
;
/*
table_charset is set in ALTER TABLE if we want change character set
for all varchar/char columns
for all varchar/char columns.
But the table charset must not affect the BLOB fields, so don't
allow to change my_charset_bin to somethig else.
*/
if
(
create_info
->
table_charset
)
if
(
create_info
->
table_charset
&&
sql_field
->
charset
!=
&
my_charset_bin
)
sql_field
->
charset
=
create_info
->
table_charset
;
sql_field
->
create_length_to_internal_length
();
...
...
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