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
c06673d4
Commit
c06673d4
authored
Oct 25, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #14290: wrong CHARACTER_MAXIMUM_LENGTH value for some text fields.
parent
c88f0e9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+8
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+9
-0
sql/sql_show.cc
sql/sql_show.cc
+3
-2
No files found.
mysql-test/r/information_schema.result
View file @
c06673d4
...
...
@@ -1025,3 +1025,11 @@ select 1 from (select 1 from test.t1) a;
1
use test;
drop table t1;
create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
data_type character_octet_length character_maximum_length
blob 65535 65535
text 65535 65535
text 65535 32767
drop table t1;
mysql-test/t/information_schema.test
View file @
c06673d4
...
...
@@ -727,3 +727,12 @@ use information_schema;
select
1
from
(
select
1
from
test
.
t1
)
a
;
use
test
;
drop
table
t1
;
#
# Bug #14290: character_maximum_length for text fields
#
create
table
t1
(
a
blob
,
b
text
charset
utf8
,
c
text
charset
ucs2
);
select
data_type
,
character_octet_length
,
character_maximum_length
from
information_schema
.
columns
where
table_name
=
't1'
;
drop
table
t1
;
sql/sql_show.cc
View file @
c06673d4
...
...
@@ -2559,8 +2559,9 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
is_blob
=
(
field
->
type
()
==
FIELD_TYPE_BLOB
);
if
(
field
->
has_charset
()
||
is_blob
)
{
longlong
char_max_len
=
is_blob
?
(
longlong
)
field
->
max_length
()
:
(
longlong
)
field
->
max_length
()
/
field
->
charset
()
->
mbmaxlen
;
longlong
char_max_len
=
is_blob
?
(
longlong
)
field
->
max_length
()
/
field
->
charset
()
->
mbminlen
:
(
longlong
)
field
->
max_length
()
/
field
->
charset
()
->
mbmaxlen
;
table
->
field
[
8
]
->
store
(
char_max_len
,
TRUE
);
table
->
field
[
8
]
->
set_notnull
();
table
->
field
[
9
]
->
store
((
longlong
)
field
->
max_length
(),
TRUE
);
...
...
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