Loading libmysql/libmysql.c +0 −29 Original line number Diff line number Diff line Loading @@ -1386,35 +1386,6 @@ mysql_get_server_info(MYSQL *mysql) } /* Get version number for server in a form easy to test on SYNOPSIS mysql_get_server_version() mysql Connection EXAMPLE 4.1.0-alfa -> 40100 NOTES We will ensure that a newer server always has a bigger number. RETURN Signed number > 323000 */ ulong STDCALL mysql_get_server_version(MYSQL *mysql) { uint major, minor, version; char *pos= mysql->server_version, *end_pos; major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; version= (uint) strtoul(pos, &end_pos, 10); return (ulong) major*10000L+(ulong) (minor*100+version); } const char * STDCALL mysql_get_host_info(MYSQL *mysql) { Loading mysql-test/r/ctype_latin1.result +22 −0 Original line number Diff line number Diff line Loading @@ -369,3 +369,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT 'a' as str; str a set @str= _latin1 'ABC ߲~ @ abc'; SELECT convert(@str collate latin1_bin using utf8); convert(@str collate latin1_bin using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_general_ci using utf8); convert(@str collate latin1_general_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_german1_ci using utf8); convert(@str collate latin1_german1_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_danish_ci using utf8); convert(@str collate latin1_danish_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_spanish_ci using utf8); convert(@str collate latin1_spanish_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_german2_ci using utf8); convert(@str collate latin1_german2_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_swedish_ci using utf8); convert(@str collate latin1_swedish_ci using utf8) ABC ߲~ @ abc mysql-test/r/view.result +17 −0 Original line number Diff line number Diff line Loading @@ -2562,3 +2562,20 @@ my_sqrt 1.4142135623731 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (id int PRIMARY KEY); CREATE TABLE t2 (id int PRIMARY KEY); INSERT INTO t1 VALUES (1), (3); INSERT INTO t2 VALUES (1), (2), (3); CREATE VIEW v2 AS SELECT * FROM t2; SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id; COUNT(*) 2 SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id; id id 1 1 3 3 SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id; COUNT(*) 2 DROP VIEW v2; DROP TABLE t1, t2; mysql-test/t/ctype_latin1.test +14 −0 Original line number Diff line number Diff line Loading @@ -95,4 +95,18 @@ SET collation_connection='latin1_bin'; CREATE TABLE a (a int); SELECT 'a' as str; # # Bug#18321: Can't store EuroSign with latin1_german1_ci and latin1_general_ci # The problem was in latin1->utf8->latin1 round trip. # set @str= _latin1 'ABC ߲~ @ abc'; SELECT convert(@str collate latin1_bin using utf8); SELECT convert(@str collate latin1_general_ci using utf8); SELECT convert(@str collate latin1_german1_ci using utf8); SELECT convert(@str collate latin1_danish_ci using utf8); SELECT convert(@str collate latin1_spanish_ci using utf8); SELECT convert(@str collate latin1_german2_ci using utf8); SELECT convert(@str collate latin1_swedish_ci using utf8); # End of 4.1 tests mysql-test/t/view.test +21 −0 Original line number Diff line number Diff line Loading @@ -2413,3 +2413,24 @@ SELECT my_sqrt FROM v1 ORDER BY my_sqrt; DROP VIEW v1; DROP TABLE t1; # # Bug #18237: invalid count optimization applied to an outer join with a view # CREATE TABLE t1 (id int PRIMARY KEY); CREATE TABLE t2 (id int PRIMARY KEY); INSERT INTO t1 VALUES (1), (3); INSERT INTO t2 VALUES (1), (2), (3); CREATE VIEW v2 AS SELECT * FROM t2; SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id; SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id; SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id; DROP VIEW v2; DROP TABLE t1, t2; Loading
libmysql/libmysql.c +0 −29 Original line number Diff line number Diff line Loading @@ -1386,35 +1386,6 @@ mysql_get_server_info(MYSQL *mysql) } /* Get version number for server in a form easy to test on SYNOPSIS mysql_get_server_version() mysql Connection EXAMPLE 4.1.0-alfa -> 40100 NOTES We will ensure that a newer server always has a bigger number. RETURN Signed number > 323000 */ ulong STDCALL mysql_get_server_version(MYSQL *mysql) { uint major, minor, version; char *pos= mysql->server_version, *end_pos; major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; version= (uint) strtoul(pos, &end_pos, 10); return (ulong) major*10000L+(ulong) (minor*100+version); } const char * STDCALL mysql_get_host_info(MYSQL *mysql) { Loading
mysql-test/r/ctype_latin1.result +22 −0 Original line number Diff line number Diff line Loading @@ -369,3 +369,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT 'a' as str; str a set @str= _latin1 'ABC ߲~ @ abc'; SELECT convert(@str collate latin1_bin using utf8); convert(@str collate latin1_bin using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_general_ci using utf8); convert(@str collate latin1_general_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_german1_ci using utf8); convert(@str collate latin1_german1_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_danish_ci using utf8); convert(@str collate latin1_danish_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_spanish_ci using utf8); convert(@str collate latin1_spanish_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_german2_ci using utf8); convert(@str collate latin1_german2_ci using utf8) ABC ߲~ @ abc SELECT convert(@str collate latin1_swedish_ci using utf8); convert(@str collate latin1_swedish_ci using utf8) ABC ߲~ @ abc
mysql-test/r/view.result +17 −0 Original line number Diff line number Diff line Loading @@ -2562,3 +2562,20 @@ my_sqrt 1.4142135623731 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (id int PRIMARY KEY); CREATE TABLE t2 (id int PRIMARY KEY); INSERT INTO t1 VALUES (1), (3); INSERT INTO t2 VALUES (1), (2), (3); CREATE VIEW v2 AS SELECT * FROM t2; SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id; COUNT(*) 2 SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id; id id 1 1 3 3 SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id; COUNT(*) 2 DROP VIEW v2; DROP TABLE t1, t2;
mysql-test/t/ctype_latin1.test +14 −0 Original line number Diff line number Diff line Loading @@ -95,4 +95,18 @@ SET collation_connection='latin1_bin'; CREATE TABLE a (a int); SELECT 'a' as str; # # Bug#18321: Can't store EuroSign with latin1_german1_ci and latin1_general_ci # The problem was in latin1->utf8->latin1 round trip. # set @str= _latin1 'ABC ߲~ @ abc'; SELECT convert(@str collate latin1_bin using utf8); SELECT convert(@str collate latin1_general_ci using utf8); SELECT convert(@str collate latin1_german1_ci using utf8); SELECT convert(@str collate latin1_danish_ci using utf8); SELECT convert(@str collate latin1_spanish_ci using utf8); SELECT convert(@str collate latin1_german2_ci using utf8); SELECT convert(@str collate latin1_swedish_ci using utf8); # End of 4.1 tests
mysql-test/t/view.test +21 −0 Original line number Diff line number Diff line Loading @@ -2413,3 +2413,24 @@ SELECT my_sqrt FROM v1 ORDER BY my_sqrt; DROP VIEW v1; DROP TABLE t1; # # Bug #18237: invalid count optimization applied to an outer join with a view # CREATE TABLE t1 (id int PRIMARY KEY); CREATE TABLE t2 (id int PRIMARY KEY); INSERT INTO t1 VALUES (1), (3); INSERT INTO t2 VALUES (1), (2), (3); CREATE VIEW v2 AS SELECT * FROM t2; SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id; SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id; SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id; DROP VIEW v2; DROP TABLE t1, t2;