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
78d9fdb1
Commit
78d9fdb1
authored
Jan 07, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
non-functional cleanup, clarifying CONVERT_IF_BIGGER_TO_BLOB
parent
ac45f3b3
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
37 additions
and
10 deletions
+37
-10
mysql-test/r/ctype_utf16.result
mysql-test/r/ctype_utf16.result
+8
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+8
-0
mysql-test/t/ctype_utf16.test
mysql-test/t/ctype_utf16.test
+4
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+5
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+1
-1
sql/item.cc
sql/item.cc
+3
-3
sql/item.h
sql/item.h
+2
-0
sql/item_sum.h
sql/item_sum.h
+1
-1
sql/opt_subselect.cc
sql/opt_subselect.cc
+2
-2
sql/sql_const.h
sql/sql_const.h
+2
-2
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/ctype_utf16.result
View file @
78d9fdb1
...
...
@@ -1140,6 +1140,14 @@ id l
a 512
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
UNION ALL
SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
id l
a 512
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
#
# End of 5.5 tests
#
mysql-test/r/ctype_utf8.result
View file @
78d9fdb1
...
...
@@ -5055,6 +5055,14 @@ id l
a 1024
Warnings:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
UNION ALL
SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
id l
a 1024
Warnings:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
#
# End of 5.5 tests
#
mysql-test/t/ctype_utf16.test
View file @
78d9fdb1
...
...
@@ -777,6 +777,10 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
GROUP
BY
id
ORDER
BY
l
DESC
;
SELECT
id
,
CHAR_LENGTH
(
GROUP_CONCAT
(
body
))
AS
l
FROM
(
SELECT
'a'
AS
id
,
REPEAT
(
'foo bar'
,
100
)
AS
body
UNION
ALL
SELECT
'a'
AS
id
,
REPEAT
(
'bla bla'
,
100
)
AS
body
)
t1
;
#
## TODO: add tests for all engines
...
...
mysql-test/t/ctype_utf8.test
View file @
78d9fdb1
...
...
@@ -1590,6 +1590,11 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
GROUP
BY
id
ORDER
BY
l
DESC
;
SELECT
id
,
CHAR_LENGTH
(
GROUP_CONCAT
(
body
))
AS
l
FROM
(
SELECT
'a'
AS
id
,
REPEAT
(
'foo bar'
,
100
)
AS
body
UNION
ALL
SELECT
'a'
AS
id
,
REPEAT
(
'bla bla'
,
100
)
AS
body
)
t1
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
mysql-test/t/func_gconcat.test
View file @
78d9fdb1
...
...
@@ -375,7 +375,7 @@ select group_concat('x') UNION ALL select 1;
drop
table
t1
;
#
# Bug #12863 : missing separators after first empty c
ancata
nated elements
# Bug #12863 : missing separators after first empty c
oncate
nated elements
#
CREATE
TABLE
t1
(
id
int
,
a
varchar
(
9
));
...
...
sql/item.cc
View file @
78d9fdb1
...
...
@@ -5579,7 +5579,7 @@ bool Item::eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs)
/**
Create a field to hold a string value from an item.
If
max_length > CONVERT_IF_BIGGER_TO_BLOB
create a blob @n
If
too_big_for_varchar()
create a blob @n
If max_length > 0 create a varchar @n
If max_length == 0 create a CHAR(0)
...
...
@@ -5594,7 +5594,7 @@ Field *Item::make_string_field(TABLE *table)
Note: the following check is repeated in
subquery_types_allow_materialization():
*/
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
CONVERT_IF_BIGGER_TO_BLOB
)
if
(
too_big_for_varchar
()
)
field
=
new
Field_blob
(
max_length
,
maybe_null
,
name
,
collation
.
collation
,
TRUE
);
/* Item_type_holder holds the exact type, do not change it */
...
...
@@ -5699,7 +5699,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
DBUG_ASSERT
(
0
);
/* If something goes awfully wrong, it's better to get a string than die */
case
MYSQL_TYPE_STRING
:
if
(
fixed_length
&&
max_length
<
CONVERT_IF_BIGGER_TO_BLOB
)
if
(
fixed_length
&&
!
too_big_for_varchar
()
)
{
field
=
new
Field_string
(
max_length
,
maybe_null
,
name
,
collation
.
collation
);
...
...
sql/item.h
View file @
78d9fdb1
...
...
@@ -1424,6 +1424,8 @@ public:
bool
eq_by_collation
(
Item
*
item
,
bool
binary_cmp
,
CHARSET_INFO
*
cs
);
uint32
max_char_length
()
const
{
return
max_length
/
collation
.
collation
->
mbmaxlen
;
}
bool
too_big_for_varchar
()
const
{
return
max_char_length
()
>
CONVERT_IF_BIGGER_TO_BLOB
;
}
void
fix_length_and_charset
(
uint32
max_char_length_arg
,
CHARSET_INFO
*
cs
)
{
max_length
=
char_to_byte_length_safe
(
max_char_length_arg
,
cs
->
mbmaxlen
);
...
...
sql/item_sum.h
View file @
78d9fdb1
...
...
@@ -1439,7 +1439,7 @@ public:
virtual
Field
*
make_string_field
(
TABLE
*
table
);
enum_field_types
field_type
()
const
{
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
CONVERT_IF_BIGGER_TO_BLOB
)
if
(
too_big_for_varchar
()
)
return
MYSQL_TYPE_BLOB
;
else
return
MYSQL_TYPE_VARCHAR
;
...
...
sql/opt_subselect.cc
View file @
78d9fdb1
...
...
@@ -853,8 +853,7 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
create a blob column because item->max_length is too big.
The following check is copied from Item::make_string_field():
*/
if
(
inner
->
max_length
/
inner
->
collation
.
collation
->
mbmaxlen
>
CONVERT_IF_BIGGER_TO_BLOB
)
if
(
inner
->
too_big_for_varchar
())
{
DBUG_RETURN
(
FALSE
);
}
...
...
@@ -3865,6 +3864,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
fn_format
(
path
,
path
,
mysql_tmpdir
,
""
,
MY_REPLACE_EXT
|
MY_UNPACK_FILENAME
);
/* STEP 2: Figure if we'll be using a key or blob+constraint */
/* it always has my_charset_bin, so mbmaxlen==1 */
if
(
uniq_tuple_length_arg
>=
CONVERT_IF_BIGGER_TO_BLOB
)
using_unique_constraint
=
TRUE
;
...
...
sql/sql_const.h
View file @
78d9fdb1
...
...
@@ -43,7 +43,7 @@
#define MAX_FIELD_CHARLENGTH 255
#define MAX_FIELD_VARCHARLENGTH 65535
#define MAX_FIELD_BLOBLENGTH UINT_MAX32
/* cf field_blob::get_length() */
#define CONVERT_IF_BIGGER_TO_BLOB 512
/* Used for CREATE ... SELECT
*/
#define CONVERT_IF_BIGGER_TO_BLOB 512
/* Threshold *in characters*
*/
/* Max column width +1 */
#define MAX_FIELD_WIDTH (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1)
...
...
sql/sql_select.cc
View file @
78d9fdb1
...
...
@@ -14185,7 +14185,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
can't index BIT fields.
*/
(
*
tmp
->
item
)
->
marker
=
4
;
// Store null in key
if
((
*
tmp
->
item
)
->
max_length
>=
CONVERT_IF_BIGGER_TO_BLOB
)
if
((
*
tmp
->
item
)
->
too_big_for_varchar
()
)
using_unique_constraint
=
1
;
}
if
(
param
->
group_length
>=
MAX_BLOB_WIDTH
)
...
...
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