Commit 3a9d0b5c authored by unknown's avatar unknown

Merge pilot.mysql.com:/data/msvensson/mysql/mysql_get_server_version/my50-mysql_get_server_version

into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.0-rpl


client/mysqltest.c:
  Auto merged
parents 4bc9360f 8a3fb5fb
...@@ -1902,6 +1902,18 @@ void var_set_errno(int sql_errno) ...@@ -1902,6 +1902,18 @@ void var_set_errno(int sql_errno)
var_set_int("$mysql_errno", sql_errno); var_set_int("$mysql_errno", sql_errno);
} }
/*
Update $mysql_get_server_version variable with version
of the currently connected server
*/
void var_set_mysql_get_server_version(MYSQL* mysql)
{
var_set_int("$mysql_get_server_version", mysql_get_server_version(mysql));
}
/* /*
Set variable from the result of a query Set variable from the result of a query
...@@ -4018,6 +4030,10 @@ int select_connection_name(const char *name) ...@@ -4018,6 +4030,10 @@ int select_connection_name(const char *name)
if (!(cur_con= find_connection_by_name(name))) if (!(cur_con= find_connection_by_name(name)))
die("connection '%s' not found in connection pool", name); die("connection '%s' not found in connection pool", name);
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -4409,6 +4425,9 @@ void do_connect(struct st_command *command) ...@@ -4409,6 +4425,9 @@ void do_connect(struct st_command *command)
next_con++; /* if we used the next_con slot, advance the pointer */ next_con++; /* if we used the next_con slot, advance the pointer */
} }
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
dynstr_free(&ds_connection_name); dynstr_free(&ds_connection_name);
dynstr_free(&ds_host); dynstr_free(&ds_host);
dynstr_free(&ds_user); dynstr_free(&ds_user);
...@@ -6924,6 +6943,9 @@ int main(int argc, char **argv) ...@@ -6924,6 +6943,9 @@ int main(int argc, char **argv)
*/ */
var_set_errno(-1); var_set_errno(-1);
/* Update $mysql_get_server_version to that of current connection */
var_set_mysql_get_server_version(&cur_con->mysql);
if (opt_include) if (opt_include)
{ {
open_file(opt_include); open_file(opt_include);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment