71
71
static bool tty_password= 0;
72
72
static bool opt_mark_progress= 0;
73
73
static bool parsing_disabled= 0;
74
static bool display_result_vertically= FALSE,
75
display_metadata= FALSE, display_result_sorted= FALSE;
74
static bool display_result_vertically= false,
75
display_metadata= false, display_result_sorted= false;
76
76
static bool disable_query_log= 0, disable_result_log= 0;
77
77
static bool disable_warnings= 0;
78
78
static bool disable_info= 1;
756
756
init_dynamic_string(arg->ds, 0, command->query_len, 256);
757
do_eval(arg->ds, start, command->end, FALSE);
757
do_eval(arg->ds, start, command->end, false);
758
758
command->last_argument= command->end;
1838
1838
/* Eval the query, thus replacing all environment variables */
1839
1839
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
1840
do_eval(&ds_query, query, end, FALSE);
1840
do_eval(&ds_query, query, end, false);
1842
1842
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
1843
1843
die("Error running query '%s': %d %s", ds_query.str,
1912
1912
static DYNAMIC_STRING ds_col;
1913
1913
static DYNAMIC_STRING ds_row;
1914
1914
const struct command_arg query_get_value_args[] = {
1915
{"query", ARG_STRING, TRUE, &ds_query, "Query to run"},
1916
{"column name", ARG_STRING, TRUE, &ds_col, "Name of column"},
1917
{"row number", ARG_STRING, TRUE, &ds_row, "Number for row"}
1915
{"query", ARG_STRING, true, &ds_query, "Query to run"},
1916
{"column name", ARG_STRING, true, &ds_col, "Name of column"},
1917
{"row number", ARG_STRING, true, &ds_row, "Number for row"}
2115
2115
static DYNAMIC_STRING ds_filename;
2116
2116
const struct command_arg source_args[] = {
2117
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to source" }
2117
{ "filename", ARG_STRING, true, &ds_filename, "File to source" }
2419
2419
static DYNAMIC_STRING ds_filename;
2420
2420
const struct command_arg rm_args[] = {
2421
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to delete" }
2421
{ "filename", ARG_STRING, true, &ds_filename, "File to delete" }
2451
2451
static DYNAMIC_STRING ds_from_file;
2452
2452
static DYNAMIC_STRING ds_to_file;
2453
2453
const struct command_arg copy_file_args[] = {
2454
{ "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to copy from" },
2455
{ "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to copy to" }
2454
{ "from_file", ARG_STRING, true, &ds_from_file, "Filename to copy from" },
2455
{ "to_file", ARG_STRING, true, &ds_to_file, "Filename to copy to" }
2487
2487
static DYNAMIC_STRING ds_mode;
2488
2488
static DYNAMIC_STRING ds_file;
2489
2489
const struct command_arg chmod_file_args[] = {
2490
{ "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file(octal) ex. 0660"},
2491
{ "filename", ARG_STRING, TRUE, &ds_file, "Filename of file to modify" }
2490
{ "mode", ARG_STRING, true, &ds_mode, "Mode of file(octal) ex. 0660"},
2491
{ "filename", ARG_STRING, true, &ds_file, "Filename of file to modify" }
2525
2525
static DYNAMIC_STRING ds_filename;
2526
2526
const struct command_arg file_exist_args[] = {
2527
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to check if it exist" }
2527
{ "filename", ARG_STRING, true, &ds_filename, "File to check if it exist" }
2556
2556
static DYNAMIC_STRING ds_dirname;
2557
2557
const struct command_arg mkdir_args[] = {
2558
{"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"}
2558
{"dirname", ARG_STRING, true, &ds_dirname, "Directory to create"}
2585
2585
static DYNAMIC_STRING ds_dirname;
2586
2586
const struct command_arg rmdir_args[] = {
2587
{"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove"}
2587
{"dirname", ARG_STRING, true, &ds_dirname, "Directory to remove"}
2672
2672
static DYNAMIC_STRING ds_filename;
2673
2673
static DYNAMIC_STRING ds_delimiter;
2674
2674
const struct command_arg write_file_args[] = {
2675
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
2676
{ "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
2675
{ "filename", ARG_STRING, true, &ds_filename, "File to write to" },
2676
{ "delimiter", ARG_STRING, false, &ds_delimiter, "Delimiter to read until" }
2784
2784
static DYNAMIC_STRING ds_filename;
2785
2785
const struct command_arg cat_file_args[] = {
2786
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to read from" }
2786
{ "filename", ARG_STRING, true, &ds_filename, "File to read from" }
2818
2818
static DYNAMIC_STRING ds_filename;
2819
2819
static DYNAMIC_STRING ds_filename2;
2820
2820
const struct command_arg diff_file_args[] = {
2821
{ "file1", ARG_STRING, TRUE, &ds_filename, "First file to diff" },
2822
{ "file2", ARG_STRING, TRUE, &ds_filename2, "Second file to diff" }
2821
{ "file1", ARG_STRING, true, &ds_filename, "First file to diff" },
2822
{ "file2", ARG_STRING, true, &ds_filename2, "Second file to diff" }
2914
2914
/* static keyword to make the NetWare compiler happy. */
2915
2915
static DYNAMIC_STRING ds_user, ds_passwd, ds_db;
2916
2916
const struct command_arg change_user_args[] = {
2917
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
2918
{ "password", ARG_STRING, FALSE, &ds_passwd, "Password used when connecting" },
2919
{ "database", ARG_STRING, FALSE, &ds_db, "Database to select after connect" },
2917
{ "user", ARG_STRING, false, &ds_user, "User to connect as" },
2918
{ "password", ARG_STRING, false, &ds_passwd, "Password used when connecting" },
2919
{ "database", ARG_STRING, false, &ds_db, "Database to select after connect" },
2975
2975
static DYNAMIC_STRING ds_script;
2976
2976
static DYNAMIC_STRING ds_delimiter;
2977
2977
const struct command_arg perl_args[] = {
2978
{ "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
2978
{ "delimiter", ARG_STRING, false, &ds_delimiter, "Delimiter to read until" }
3058
3058
init_dynamic_string(&ds_echo, "", command->query_len, 256);
3059
do_eval(&ds_echo, command->first_argument, command->end, FALSE);
3059
do_eval(&ds_echo, command->first_argument, command->end, false);
3060
3060
dynstr_append_mem(&ds_res, ds_echo.str, ds_echo.length);
3061
3061
dynstr_append_mem(&ds_res, "\n", 1);
3062
3062
dynstr_free(&ds_echo);
3236
3236
while (*p && my_isspace(charset_info,*p))
3239
do_eval(&let_rhs_expr, p, command->end, FALSE);
3239
do_eval(&let_rhs_expr, p, command->end, false);
3241
3241
command->last_argument= command->end;
3242
3242
/* Assign var_val to var_name */
3842
3842
static DYNAMIC_STRING ds_sock;
3843
3843
static DYNAMIC_STRING ds_options;
3844
3844
const struct command_arg connect_args[] = {
3845
{ "connection name", ARG_STRING, TRUE, &ds_connection_name, "Name of the connection" },
3846
{ "host", ARG_STRING, TRUE, &ds_host, "Host to connect to" },
3847
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
3848
{ "passsword", ARG_STRING, FALSE, &ds_password, "Password used when connecting" },
3849
{ "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
3850
{ "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
3851
{ "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
3852
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" }
3845
{ "connection name", ARG_STRING, true, &ds_connection_name, "Name of the connection" },
3846
{ "host", ARG_STRING, true, &ds_host, "Host to connect to" },
3847
{ "user", ARG_STRING, false, &ds_user, "User to connect as" },
3848
{ "passsword", ARG_STRING, false, &ds_password, "Password used when connecting" },
3849
{ "database", ARG_STRING, false, &ds_database, "Database to select after connect" },
3850
{ "port", ARG_STRING, false, &ds_port, "Port to connect to" },
3851
{ "socket", ARG_STRING, false, &ds_sock, "Socket to connect with" },
3852
{ "options", ARG_STRING, false, &ds_options, "Options to use while connecting" }
5405
5405
if (command->type == Q_EVAL)
5407
5407
init_dynamic_string(&eval_query, "", command->query_len+256, 1024);
5408
do_eval(&eval_query, command->query, command->end, FALSE);
5408
do_eval(&eval_query, command->query, command->end, false);
5409
5409
query = eval_query.str;
5410
5410
query_len = eval_query.length;
5778
5778
do_delimiter(command);
5780
5780
case Q_DISPLAY_VERTICAL_RESULTS:
5781
display_result_vertically= TRUE;
5781
display_result_vertically= true;
5783
5783
case Q_DISPLAY_HORIZONTAL_RESULTS:
5784
display_result_vertically= FALSE;
5784
display_result_vertically= false;
5786
5786
case Q_SORTED_RESULT:
5788
5788
Turn on sorting of result set, will be reset after next
5791
display_result_sorted= TRUE;
5791
display_result_sorted= true;
5793
5793
case Q_LET: do_let(command); break;
5794
5794
case Q_EVAL_RESULT: