Commit a8a8c8c1 authored by msvensson@pilot.blaudden's avatar msvensson@pilot.blaudden

Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
parents 84d60374 e9a9107f
...@@ -1329,23 +1329,31 @@ void var_set(const char *var_name, const char *var_name_end, ...@@ -1329,23 +1329,31 @@ void var_set(const char *var_name, const char *var_name_end,
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
void var_set_string(const char* name, const char* value)
{
var_set(name, name + strlen(name), value, value + strlen(value));
}
void var_set_int(const char* name, int value)
{
char buf[21];
snprintf(buf, sizeof(buf), "%d", value);
var_set_string(name, buf);
}
/* /*
Store an integer (typically the returncode of the last SQL) Store an integer (typically the returncode of the last SQL)
statement in the mysqltest builtin variable $mysql_errno, by statement in the mysqltest builtin variable $mysql_errno
simulating of a user statement "let $mysql_errno= <integer>"
*/ */
void var_set_errno(int sql_errno) void var_set_errno(int sql_errno)
{ {
/* TODO MASV make easier */ var_set_int("$mysql_errno", sql_errno);
const char *var_name= "$mysql_errno";
char var_val[21];
uint length= my_sprintf(var_val, (var_val, "%d", sql_errno));
var_set(var_name, var_name + 12, var_val, var_val + length);
return;
} }
/* /*
Set variable from the result of a query Set variable from the result of a query
...@@ -6011,6 +6019,8 @@ int main(int argc, char **argv) ...@@ -6011,6 +6019,8 @@ int main(int argc, char **argv)
1024, 0, 0, get_var_key, var_free, MYF(0))) 1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed"); die("Variable hash initialization failed");
var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
memset(&master_pos, 0, sizeof(master_pos)); memset(&master_pos, 0, sizeof(master_pos));
parser.current_line= parser.read_lines= 0; parser.current_line= parser.read_lines= 0;
......
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