Loading client/mysql.cc +2 −2 Original line number Diff line number Diff line Loading @@ -2896,7 +2896,7 @@ com_connect(String *buffer, char *line) bzero(buff, sizeof(buff)); if (buffer) { strmake(buff, line, sizeof(buff)); strmake(buff, line, sizeof(buff) - 1); tmp= get_arg(buff, 0); if (tmp && *tmp) { Loading Loading @@ -3011,7 +3011,7 @@ com_use(String *buffer __attribute__((unused)), char *line) int select_db; bzero(buff, sizeof(buff)); strmov(buff, line); strmake(buff, line, sizeof(buff) - 1); tmp= get_arg(buff, 0); if (!tmp || !*tmp) { Loading include/mysql_com.h +4 −4 Original line number Diff line number Diff line Loading @@ -141,11 +141,11 @@ enum enum_server_command #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ #define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (((ulong) 1) << 17) /* Enable/disable multi-results */ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ #define CLIENT_SSL_VERIFY_SERVER_CERT (((ulong) 1) << 30) #define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31) #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define CLIENT_REMEMBER_OPTIONS (1UL << 31) #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ Loading mysql-test/r/ctype_utf8.result +12 −0 Original line number Diff line number Diff line Loading @@ -1353,6 +1353,18 @@ database() имя_базы_в_кодировке_утф8_длиной_больше_чем_45 drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45; use test; create table t1(a char(10)) default charset utf8; insert into t1 values ('123'), ('456'); explain select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort 1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; substr(Z.a,-1) a 3 123 6 456 drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; Loading mysql-test/r/func_time.result +12 −0 Original line number Diff line number Diff line Loading @@ -890,6 +890,18 @@ t1 CREATE TABLE `t1` ( `from_unixtime(1) + 0` double(23,6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; 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; (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H); Loading mysql-test/t/ctype_utf8.test +11 −0 Original line number Diff line number Diff line Loading @@ -1086,6 +1086,17 @@ select database(); drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45; use test; # # Bug #20204: "order by" changes the results returned # create table t1(a char(10)) default charset utf8; insert into t1 values ('123'), ('456'); explain select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; drop table t1; # End of 4.1 tests # Loading Loading
client/mysql.cc +2 −2 Original line number Diff line number Diff line Loading @@ -2896,7 +2896,7 @@ com_connect(String *buffer, char *line) bzero(buff, sizeof(buff)); if (buffer) { strmake(buff, line, sizeof(buff)); strmake(buff, line, sizeof(buff) - 1); tmp= get_arg(buff, 0); if (tmp && *tmp) { Loading Loading @@ -3011,7 +3011,7 @@ com_use(String *buffer __attribute__((unused)), char *line) int select_db; bzero(buff, sizeof(buff)); strmov(buff, line); strmake(buff, line, sizeof(buff) - 1); tmp= get_arg(buff, 0); if (!tmp || !*tmp) { Loading
include/mysql_com.h +4 −4 Original line number Diff line number Diff line Loading @@ -141,11 +141,11 @@ enum enum_server_command #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ #define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (((ulong) 1) << 17) /* Enable/disable multi-results */ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ #define CLIENT_SSL_VERIFY_SERVER_CERT (((ulong) 1) << 30) #define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31) #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define CLIENT_REMEMBER_OPTIONS (1UL << 31) #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ Loading
mysql-test/r/ctype_utf8.result +12 −0 Original line number Diff line number Diff line Loading @@ -1353,6 +1353,18 @@ database() имя_базы_в_кодировке_утф8_длиной_больше_чем_45 drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45; use test; create table t1(a char(10)) default charset utf8; insert into t1 values ('123'), ('456'); explain select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort 1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; substr(Z.a,-1) a 3 123 6 456 drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; Loading
mysql-test/r/func_time.result +12 −0 Original line number Diff line number Diff line Loading @@ -890,6 +890,18 @@ t1 CREATE TABLE `t1` ( `from_unixtime(1) + 0` double(23,6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; 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; (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H); Loading
mysql-test/t/ctype_utf8.test +11 −0 Original line number Diff line number Diff line Loading @@ -1086,6 +1086,17 @@ select database(); drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45; use test; # # Bug #20204: "order by" changes the results returned # create table t1(a char(10)) default charset utf8; insert into t1 values ('123'), ('456'); explain select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1; drop table t1; # End of 4.1 tests # Loading