mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
fixed BUG #2874 "Grant table bug" and
added tests for testing structure of mysql db client/mysqltest.c: extend "replace" to column names extend "disable_result_log" to output of --exec commad mysql-test/install_test_db.sh: corrected wrong column definitions (as a result of tests) mysql-test/mysql-test-run.sh: export MYSQL and MYSQL_FIX_SYSTEM_TABLES + added option --result-file for *.opt files scripts/mysql_fix_privilege_tables.sh: added new options to using in tests + added new alters (as a result of new tests) scripts/mysql_fix_privilege_tables.sql: added new alters (as a result of new tests) scripts/mysql_install_db.sh: corrected definition of tables_priv.Table_name
This commit is contained in:
parent
c0422729cf
commit
2053f8f850
13 changed files with 474 additions and 51 deletions
|
|
@ -867,36 +867,46 @@ int do_exec(struct st_query* q)
|
|||
if (!*cmd)
|
||||
die("Missing argument in exec\n");
|
||||
|
||||
if (q->record_file[0])
|
||||
if (disable_result_log)
|
||||
{
|
||||
init_dynamic_string(&ds_tmp, "", 16384, 65536);
|
||||
ds= &ds_tmp;
|
||||
if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
|
||||
die("popen() failed\n");
|
||||
while (fgets(buf, sizeof(buf), res_file));
|
||||
pclose(res_file);
|
||||
}
|
||||
else
|
||||
ds= &ds_res;
|
||||
{
|
||||
if (q->record_file[0])
|
||||
{
|
||||
init_dynamic_string(&ds_tmp, "", 16384, 65536);
|
||||
ds= &ds_tmp;
|
||||
}
|
||||
else
|
||||
ds= &ds_res;
|
||||
|
||||
if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
|
||||
die("popen() failed\n");
|
||||
while (fgets(buf, sizeof(buf), res_file))
|
||||
replace_dynstr_append_mem(ds, buf, strlen(buf));
|
||||
pclose(res_file);
|
||||
if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
|
||||
die("popen() failed\n");
|
||||
while (fgets(buf, sizeof(buf), res_file))
|
||||
replace_dynstr_append_mem(ds, buf, strlen(buf));
|
||||
pclose(res_file);
|
||||
|
||||
if (glob_replace)
|
||||
free_replace();
|
||||
if (glob_replace)
|
||||
free_replace();
|
||||
|
||||
if (record)
|
||||
{
|
||||
if (!q->record_file[0] && !result_file)
|
||||
die("At line %u: Missing result file", start_lineno);
|
||||
if (!result_file)
|
||||
str_to_file(q->record_file, ds->str, ds->length);
|
||||
if (record)
|
||||
{
|
||||
if (!q->record_file[0] && !result_file)
|
||||
die("At line %u: Missing result file", start_lineno);
|
||||
if (!result_file)
|
||||
str_to_file(q->record_file, ds->str, ds->length);
|
||||
}
|
||||
else if (q->record_file[0])
|
||||
{
|
||||
error= check_result(ds, q->record_file, q->require_file);
|
||||
}
|
||||
if (ds == &ds_tmp)
|
||||
dynstr_free(&ds_tmp);
|
||||
}
|
||||
else if (q->record_file[0])
|
||||
{
|
||||
error= check_result(ds, q->record_file, q->require_file);
|
||||
}
|
||||
if (ds == &ds_tmp)
|
||||
dynstr_free(&ds_tmp);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
@ -2251,7 +2261,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
|
|||
{
|
||||
if (i)
|
||||
dynstr_append_mem(ds, "\t", 1);
|
||||
dynstr_append(ds, fields[i].name);
|
||||
replace_dynstr_append_mem(ds, fields[i].name, strlen(fields[i].name));
|
||||
}
|
||||
dynstr_append_mem(ds, "\n", 1);
|
||||
append_result(ds, res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue