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
037d9fae
Commit
037d9fae
authored
Mar 08, 2011
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
merge from 5.1 main
parents
4a54e5ad
a1e9be8e
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
152 additions
and
12 deletions
+152
-12
mysql-test/r/ctype_sjis.result
mysql-test/r/ctype_sjis.result
+6
-0
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+13
-2
mysql-test/r/func_encrypt_ucs2.result
mysql-test/r/func_encrypt_ucs2.result
+19
-0
mysql-test/r/xml.result
mysql-test/r/xml.result
+8
-0
mysql-test/suite/engines/iuds/r/insert_year.result
mysql-test/suite/engines/iuds/r/insert_year.result
+2
-2
mysql-test/t/ctype_sjis.test
mysql-test/t/ctype_sjis.test
+8
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+6
-0
mysql-test/t/func_encrypt_ucs2.test
mysql-test/t/func_encrypt_ucs2.test
+12
-0
mysql-test/t/xml.test
mysql-test/t/xml.test
+5
-0
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+61
-3
sql/item_strfunc.h
sql/item_strfunc.h
+3
-2
sql/sql_parse.cc
sql/sql_parse.cc
+2
-1
strings/xml.c
strings/xml.c
+6
-1
No files found.
mysql-test/r/ctype_sjis.result
View file @
037d9fae
...
...
@@ -218,4 +218,10 @@ hex(a) hex(lower(a)) hex(upper(a))
8352835E 8352835E 8352835E
8372835E 8372835E 8372835E
DROP TABLE t1;
#
# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
#
SELECT QUOTE('ソ');
QUOTE('ソ')
'ソ'
# End of 5.1 tests
mysql-test/r/ctype_ucs.result
View file @
037d9fae
...
...
@@ -990,8 +990,8 @@ old_password(name)
????????
select quote(name) from bug20536;
quote(name)
????????
????????????????
'test1'
'\'test\\_2\''
drop table bug20536;
set names ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
...
...
@@ -1238,4 +1238,15 @@ CREATE VIEW v1 AS SELECT 1 from t1
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
#
# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
#
SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850))
00
SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
End of 5.0 tests
mysql-test/r/func_encrypt_ucs2.result
0 → 100644
View file @
037d9fae
#
# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
#
SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)))
9
SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '?T?iK?j??'
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)))
4
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'test'
mysql-test/r/xml.result
View file @
037d9fae
...
...
@@ -1124,4 +1124,12 @@ Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT une
SELECT
UPDATEXML
(
CONVERT
(
_latin1
'<!
--
'
USING
utf8
),'
1
','
1
');
UPDATEXML
(
CONVERT
(
_latin1
'<!
--
'
USING
utf8
),'
1
','
1
')
NULL
#
#
Bug#11766725
(
bug#59901
)
:
EXTRACTVALUE
STILL
BROKEN
AFTER
FIX
FOR
BUG
#44332
#
SELECT
ExtractValue
(
CONVERT
('<\"',
BINARY
(
10
)),
1
);
ExtractValue
(
CONVERT
('<\"',
BINARY
(
10
)),
1
)
NULL
Warnings:
Warning
1525
Incorrect
XML
value:
'
parse
error
at
line
1
pos
11:
STRING
unexpected
(
ident
or
'/'
wanted
)'
End
of
5
.
1
tests
mysql-test/suite/engines/iuds/r/insert_year.result
View file @
037d9fae
...
...
@@ -2431,7 +2431,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3;
total_rows min_value max(c2)
21
1901
2155
21
0
2155
SELECT * FROM t3 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
...
...
@@ -2838,7 +2838,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3;
total_rows min_value max(c2)
21
1901
2155
21
0
2155
SELECT * FROM t3 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
...
...
mysql-test/t/ctype_sjis.test
View file @
037d9fae
...
...
@@ -92,4 +92,12 @@ INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
SELECT
hex
(
a
),
hex
(
lower
(
a
)),
hex
(
upper
(
a
))
FROM
t1
ORDER
BY
binary
(
a
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
--
echo
#
# In the below string backslash (0x5C) is a part of a multi-byte
# character, so it should not be quoted.
SELECT
QUOTE
(
'\'
);
--
echo
# End of 5.1 tests
mysql-test/t/ctype_ucs.test
View file @
037d9fae
...
...
@@ -741,4 +741,10 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
--
echo
#
SELECT
HEX
(
CHAR
(
COALESCE
(
NULL
,
CHAR
(
COUNT
(
'%s'
)
USING
ucs2
),
1
,
@@
global
.
license
,
NULL
)
USING
cp850
));
SELECT
CONVERT
(
QUOTE
(
CHAR
(
0xf5
using
ucs2
)),
SIGNED
);
--
echo
End
of
5.0
tests
mysql-test/t/func_encrypt_ucs2.test
0 → 100644
View file @
037d9fae
--
source
include
/
have_ssl
.
inc
--
source
include
/
have_ucs2
.
inc
--
echo
#
--
echo
# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
--
echo
#
SELECT
CHAR_LENGTH
(
DES_ENCRYPT
(
0
,
CHAR
(
'1'
USING
ucs2
)));
SELECT
CONVERT
(
DES_ENCRYPT
(
0
,
CHAR
(
'1'
USING
ucs2
)),
UNSIGNED
);
SELECT
CHAR_LENGTH
(
DES_DECRYPT
(
0xFF0DC9FC9537CA75F4
,
CHAR
(
'1'
USING
ucs2
)));
SELECT
CONVERT
(
DES_DECRYPT
(
0xFF0DC9FC9537CA75F4
,
CHAR
(
'1'
using
ucs2
)),
UNSIGNED
);
mysql-test/t/xml.test
View file @
037d9fae
...
...
@@ -646,4 +646,9 @@ SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
SELECT
UPDATEXML
(
CONVERT
(
_latin1
'<'
USING
utf8
),
'1'
,
'1'
);
SELECT
UPDATEXML
(
CONVERT
(
_latin1
'<!--'
USING
utf8
),
'1'
,
'1'
);
--
echo
#
--
echo
# Bug#11766725 (bug#59901): EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
--
echo
#
SELECT
ExtractValue
(
CONVERT
(
'<\"'
,
BINARY
(
10
)),
1
);
--
echo
End
of
5.1
tests
sql/item_func.cc
View file @
037d9fae
...
...
@@ -840,7 +840,7 @@ longlong Item_func_numhybrid::val_int()
return
0
;
char
*
end
=
(
char
*
)
res
->
ptr
()
+
res
->
length
();
CHARSET_INFO
*
cs
=
str_value
.
charset
();
CHARSET_INFO
*
cs
=
res
->
charset
();
return
(
*
(
cs
->
cset
->
strtoll10
))(
cs
,
res
->
ptr
(),
&
end
,
&
err_not_used
);
}
default:
...
...
sql/item_strfunc.cc
View file @
037d9fae
...
...
@@ -519,6 +519,7 @@ String *Item_func_des_encrypt::val_str(String *str)
tmp_arg
[
res_length
-
1
]
=
tail
;
// save extra length
tmp_value
.
realloc
(
res_length
+
1
);
tmp_value
.
length
(
res_length
+
1
);
tmp_value
.
set_charset
(
&
my_charset_bin
);
tmp_value
[
0
]
=
(
char
)
(
128
|
key_number
);
// Real encryption
bzero
((
char
*
)
&
ivec
,
sizeof
(
ivec
));
...
...
@@ -606,6 +607,7 @@ String *Item_func_des_decrypt::val_str(String *str)
if
((
tail
=
(
uint
)
(
uchar
)
tmp_value
[
length
-
2
])
>
8
)
goto
wrong_key
;
// Wrong key
tmp_value
.
length
(
length
-
1
-
tail
);
tmp_value
.
set_charset
(
&
my_charset_bin
);
return
&
tmp_value
;
error:
...
...
@@ -3212,14 +3214,68 @@ String *Item_func_quote::val_str(String *str)
}
arg_length
=
arg
->
length
();
new_length
=
arg_length
+
2
;
/* for beginning and ending ' signs */
for
(
from
=
(
char
*
)
arg
->
ptr
(),
end
=
from
+
arg_length
;
from
<
end
;
from
++
)
new_length
+=
get_esc_bit
(
escmask
,
(
uchar
)
*
from
);
if
(
collation
.
collation
->
mbmaxlen
==
1
)
{
new_length
=
arg_length
+
2
;
/* for beginning and ending ' signs */
for
(
from
=
(
char
*
)
arg
->
ptr
(),
end
=
from
+
arg_length
;
from
<
end
;
from
++
)
new_length
+=
get_esc_bit
(
escmask
,
(
uchar
)
*
from
);
}
else
{
new_length
=
(
arg_length
*
2
)
+
/* For string characters */
(
2
*
collation
.
collation
->
mbmaxlen
);
/* For quotes */
}
if
(
tmp_value
.
alloc
(
new_length
))
goto
null
;
if
(
collation
.
collation
->
mbmaxlen
>
1
)
{
CHARSET_INFO
*
cs
=
collation
.
collation
;
int
mblen
;
uchar
*
to_end
;
to
=
(
char
*
)
tmp_value
.
ptr
();
to_end
=
(
uchar
*
)
to
+
new_length
;
/* Put leading quote */
if
((
mblen
=
cs
->
cset
->
wc_mb
(
cs
,
'\''
,
(
uchar
*
)
to
,
to_end
))
<=
0
)
goto
null
;
to
+=
mblen
;
for
(
start
=
(
char
*
)
arg
->
ptr
(),
end
=
start
+
arg_length
;
start
<
end
;
)
{
my_wc_t
wc
;
bool
escape
;
if
((
mblen
=
cs
->
cset
->
mb_wc
(
cs
,
&
wc
,
(
uchar
*
)
start
,
(
uchar
*
)
end
))
<=
0
)
goto
null
;
start
+=
mblen
;
switch
(
wc
)
{
case
0
:
escape
=
1
;
wc
=
'0'
;
break
;
case
'\032'
:
escape
=
1
;
wc
=
'Z'
;
break
;
case
'\''
:
escape
=
1
;
break
;
case
'\\'
:
escape
=
1
;
break
;
default:
escape
=
0
;
break
;
}
if
(
escape
)
{
if
((
mblen
=
cs
->
cset
->
wc_mb
(
cs
,
'\\'
,
(
uchar
*
)
to
,
to_end
))
<=
0
)
goto
null
;
to
+=
mblen
;
}
if
((
mblen
=
cs
->
cset
->
wc_mb
(
cs
,
wc
,
(
uchar
*
)
to
,
to_end
))
<=
0
)
goto
null
;
to
+=
mblen
;
}
/* Put trailing quote */
if
((
mblen
=
cs
->
cset
->
wc_mb
(
cs
,
'\''
,
(
uchar
*
)
to
,
to_end
))
<=
0
)
goto
null
;
to
+=
mblen
;
new_length
=
to
-
tmp_value
.
ptr
();
goto
ret
;
}
/*
We replace characters from the end to the beginning
*/
...
...
@@ -3251,6 +3307,8 @@ String *Item_func_quote::val_str(String *str)
}
}
*
to
=
'\''
;
ret:
tmp_value
.
length
(
new_length
);
tmp_value
.
set_charset
(
collation
.
collation
);
null_value
=
0
;
...
...
sql/item_strfunc.h
View file @
037d9fae
...
...
@@ -704,9 +704,10 @@ public:
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
ulonglong
max_result_length
=
(
ulonglong
)
args
[
0
]
->
max_length
*
2
+
2
;
max_length
=
(
uint32
)
min
(
max_result_length
,
MAX_BLOB_WIDTH
);
collation
.
set
(
args
[
0
]
->
collation
);
ulonglong
max_result_length
=
(
ulonglong
)
args
[
0
]
->
max_length
*
2
+
2
*
collation
.
collation
->
mbmaxlen
;
max_length
=
(
uint32
)
min
(
max_result_length
,
MAX_BLOB_WIDTH
);
}
};
...
...
sql/sql_parse.cc
View file @
037d9fae
...
...
@@ -1218,7 +1218,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
We have checked charset earlier,
so thd_init_client_charset cannot fail.
*/
DBUG_ASSERT
(
!
thd_init_client_charset
(
thd
,
cs_number
));
if
(
thd_init_client_charset
(
thd
,
cs_number
))
DBUG_ASSERT
(
0
);
thd
->
update_charset
();
}
}
...
...
strings/xml.c
View file @
037d9fae
...
...
@@ -165,11 +165,16 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
}
else
if
(
(
p
->
cur
[
0
]
==
'"'
)
||
(
p
->
cur
[
0
]
==
'\''
)
)
{
/*
"string" or 'string' found.
Scan until the closing quote/doublequote, or until the END-OF-INPUT.
*/
p
->
cur
++
;
for
(;
(
p
->
cur
<
p
->
end
)
&&
(
p
->
cur
[
0
]
!=
a
->
beg
[
0
]);
p
->
cur
++
)
{}
a
->
end
=
p
->
cur
;
if
(
a
->
beg
[
0
]
==
p
->
cur
[
0
])
p
->
cur
++
;
if
(
p
->
cur
<
p
->
end
)
/* Closing quote or doublequote has been found */
p
->
cur
++
;
a
->
beg
++
;
if
(
!
(
p
->
flags
&
MY_XML_FLAG_SKIP_TEXT_NORMALIZATION
))
my_xml_norm_text
(
a
);
...
...
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