diff options
author | bar@mysql.com <> | 2006-04-06 13:03:22 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2006-04-06 13:03:22 +0500 |
commit | 13b5cdb12632f9d89bdaddff9ccc9638394baab8 (patch) | |
tree | 007b32aeace228a6d36d6d05bc89fc7f1ec945da | |
parent | 14846536a45291715084b1c5361c77c38f6c83dd (diff) | |
download | mariadb-git-13b5cdb12632f9d89bdaddff9ccc9638394baab8.tar.gz |
Moving mysql_get_server_version() from libmysql.c to client.c,
as it is now required by mysql_set_character_set()
-rw-r--r-- | libmysql/libmysql.c | 29 | ||||
-rw-r--r-- | sql-common/client.c | 30 |
2 files changed, 30 insertions, 29 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 323ddfca36f..bfec476fde3 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -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) { diff --git a/sql-common/client.c b/sql-common/client.c index e7e74795fa0..84df31b7440 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2817,6 +2817,36 @@ const char * STDCALL mysql_error(MYSQL *mysql) return mysql->net.last_error; } + +/* + 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); +} + + /* mysql_set_character_set function sends SET NAMES cs_name to the server (which changes character_set_client, character_set_result |