1049
1049
MY_INIT(argv[0]);
1051
DBUG_PROCESS(argv[0]);
1053
1051
delimiter_str= delimiter;
1054
1052
default_prompt = my_strdup(getenv("MYSQL_PS1") ?
1055
1053
getenv("MYSQL_PS1") :
1056
"mysql> ",MYF(MY_WME));
1054
"drizzle> ",MYF(MY_WME));
1057
1055
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
1058
1056
prompt_counter=0;
1321
1319
{"compress", 'C', "Use compression in server/client protocol.",
1322
1320
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1326
{"debug", '#', "This is a non-debug version. Catch this and exit",
1327
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
1329
{"debug", '#', "Output debug log", (char**) &default_dbug_option,
1330
(char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
1332
1322
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
1333
1323
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
1334
1324
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1895
1879
if (commands[i].func &&
1896
1880
((name && !my_strnncoll(charset_info,(uchar*)name,len, (uchar*)commands[i].name,len) && !commands[i].name[len] && (!end || (end && commands[i].takes_params))) || (!name && commands[i].cmd_char == cmd_char)))
1898
DBUG_PRINT("exit",("found command: %s", commands[i].name));
1899
DBUG_RETURN(&commands[i]);
1882
return(&commands[i]);
1902
DBUG_RETURN((COMMANDS *) 0);
1885
return((COMMANDS *) 0);
2161
2144
if (buffer.length() + length >= buffer.alloced_length())
2162
2145
buffer.realloc(buffer.length()+length+IO_SIZE);
2163
2146
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
2169
2152
/*****************************************************************
2376
2359
MYSQL_FIELD *sql_field;
2377
2360
char buf[NAME_LEN*2+2]; // table name plus field name plus 2
2378
2361
int i,j,num_fields;
2379
DBUG_ENTER("build_completion_hash");
2381
2364
if (status.batch || quick || !current_db)
2382
DBUG_VOID_RETURN; // We don't need completion in batches
2365
return; // We don't need completion in batches
2386
2369
/* Free old used memory */
2387
2370
if (field_names)
2439
2422
/* hash all field names, both with the table prefix and without it */
2440
2423
if (!tables) /* no tables */
2444
2427
mysql_data_seek(tables,0);
2445
2428
if (!(field_names= (char ***) alloc_root(&hash_mem_root,sizeof(char **) *
2446
2429
(uint) (mysql_num_rows(tables)+1))))
2448
2431
mysql_free_result(tables);
2452
2435
while ((table_row=mysql_fetch_row(tables)))
3240
3223
MYSQL_FIELD *field;
3241
3224
MYSQL_FIELD_OFFSET offset;
3244
3226
offset= mysql_field_tell(result);
3245
DBUG_ASSERT(offset == 0);
3227
assert(offset == 0);
3250
3229
while ((field= mysql_fetch_field(result)) != NULL)
3251
3230
len+= get_field_disp_length(field) + 3; /* plus bar, space, & final space */