Commit 8cf2e2f3 authored by msvensson@pilot.mysql.com's avatar msvensson@pilot.mysql.com

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

into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
parents ae3f3082 616c218a
...@@ -1887,6 +1887,18 @@ void var_set_errno(int sql_errno) ...@@ -1887,6 +1887,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
...@@ -4016,6 +4028,10 @@ int select_connection_name(const char *name) ...@@ -4016,6 +4028,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);
} }
...@@ -4403,6 +4419,9 @@ void do_connect(struct st_command *command) ...@@ -4403,6 +4419,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);
...@@ -6926,6 +6945,9 @@ int main(int argc, char **argv) ...@@ -6926,6 +6945,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