mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into maint1.mysql.com:/data/localhome/tnurnberg/my50-21913
This commit is contained in:
commit
ab7810c8e9
3 changed files with 36 additions and 1 deletions
|
@ -1053,3 +1053,15 @@ id day id day
|
|||
3 2005-07-01 3 2005-07-15
|
||||
DROP TABLE t1,t2;
|
||||
set time_zone= @@global.time_zone;
|
||||
SET NAMES latin1;
|
||||
SET character_set_results = NULL;
|
||||
SHOW VARIABLES LIKE 'character_set_results';
|
||||
Variable_name Value
|
||||
character_set_results
|
||||
CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
|
||||
INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
|
||||
SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
|
||||
fmtddate field2
|
||||
Sep-4 12:00AM abcd
|
||||
DROP TABLE testBug8868;
|
||||
SET NAMES DEFAULT;
|
||||
|
|
|
@ -583,3 +583,21 @@ DROP TABLE t1,t2;
|
|||
|
||||
# Restore timezone to default
|
||||
set time_zone= @@global.time_zone;
|
||||
|
||||
#
|
||||
# 21913: DATE_FORMAT() Crashes mysql server if I use it through
|
||||
# mysql-connector-j driver.
|
||||
#
|
||||
|
||||
SET NAMES latin1;
|
||||
SET character_set_results = NULL;
|
||||
SHOW VARIABLES LIKE 'character_set_results';
|
||||
|
||||
CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
|
||||
INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
|
||||
|
||||
SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
|
||||
|
||||
DROP TABLE testBug8868;
|
||||
|
||||
SET NAMES DEFAULT;
|
||||
|
|
|
@ -248,6 +248,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
|
|||
0 No conversion needed
|
||||
1 Either character set conversion or adding leading zeros
|
||||
(e.g. for UCS-2) must be done
|
||||
|
||||
NOTE
|
||||
to_cs may be NULL for "no conversion" if the system variable
|
||||
character_set_results is NULL.
|
||||
*/
|
||||
|
||||
bool String::needs_conversion(uint32 arg_length,
|
||||
|
@ -256,7 +260,8 @@ bool String::needs_conversion(uint32 arg_length,
|
|||
uint32 *offset)
|
||||
{
|
||||
*offset= 0;
|
||||
if ((to_cs == &my_charset_bin) ||
|
||||
if (!to_cs ||
|
||||
(to_cs == &my_charset_bin) ||
|
||||
(to_cs == from_cs) ||
|
||||
my_charset_same(from_cs, to_cs) ||
|
||||
((from_cs == &my_charset_bin) &&
|
||||
|
|
Loading…
Reference in a new issue