236
430
static char *get_arg(char *line, bool get_next_arg);
237
431
static void init_username(void);
238
432
static void add_int_to_prompt(int toadd);
239
static int get_result_width(DRIZZLE_RES *res);
240
static int get_field_disp_length(DRIZZLE_FIELD * field);
241
static const char * strcont(register const char *str, register const char *set);
433
static int get_result_width(drizzle_result_st *res);
434
static int get_field_disp_length(drizzle_column_st * field);
435
static const char * strcont(const char *str, const char *set);
243
/* A structure which contains information on the commands this program
437
/* A class which contains information on the commands this program
244
438
can understand. */
246
442
const char *name; /* User printable name of the function. */
247
443
char cmd_char; /* msql command character */
248
int (*func)(string *str,const char *); /* Function to call to do the job. */
445
Commands(const char *in_name,
447
int (*in_func)(string *str,const char *name),
448
bool in_takes_params,
449
const char *in_doc) :
451
cmd_char(in_cmd_char),
453
takes_params(in_takes_params),
465
int (*func)(string *str,const char *);/* Function to call to do the job. */
467
const char *getName() const
472
char getCmdChar() const
477
bool getTakesParams() const
482
const char *getDoc() const
487
void setName(const char *in_name)
492
void setCmdChar(char in_cmd_char)
494
cmd_char= in_cmd_char;
497
void setTakesParams(bool in_takes_params)
499
takes_params= in_takes_params;
502
void setDoc(const char *in_doc)
249
508
bool takes_params; /* Max parameters for command */
250
509
const char *doc; /* Documentation for this function. */
254
static COMMANDS commands[] = {
255
{ "?", '?', com_help, 1, N_("Synonym for `help'.") },
256
{ "clear", 'c', com_clear, 0, N_("Clear command.")},
257
{ "connect",'r', com_connect,1,
258
N_("Reconnect to the server. Optional arguments are db and host." }),
259
{ "delimiter", 'd', com_delimiter, 1,
260
N_("Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.") },
261
{ "ego", 'G', com_ego, 0,
262
N_("Send command to drizzle server, display result vertically.")},
263
{ "exit", 'q', com_quit, 0, N_("Exit drizzle. Same as quit.")},
264
{ "go", 'g', com_go, 0, N_("Send command to drizzle server.") },
265
{ "help", 'h', com_help, 1, N_("Display this help.") },
266
{ "nopager",'n', com_nopager,0, N_("Disable pager, print to stdout.") },
267
{ "notee", 't', com_notee, 0, N_("Don't write into outfile.") },
268
{ "pager", 'P', com_pager, 1,
269
N_("Set PAGER [to_pager]. Print the query results via PAGER.") },
270
{ "print", 'p', com_print, 0, N_("Print current command.") },
271
{ "prompt", 'R', com_prompt, 1, N_("Change your drizzle prompt.")},
272
{ "quit", 'q', com_quit, 0, N_("Quit drizzle.") },
273
{ "rehash", '#', com_rehash, 0, N_("Rebuild completion hash.") },
274
{ "source", '.', com_source, 1,
275
N_("Execute an SQL script file. Takes a file name as an argument.")},
276
{ "status", 's', com_status, 0, N_("Get status information from the server.")},
277
{ "tee", 'T', com_tee, 1,
278
N_("Set outfile [to_outfile]. Append everything into given outfile.") },
279
{ "use", 'u', com_use, 1,
280
N_("Use another database. Takes database name as argument.") },
281
{ "warnings", 'W', com_warnings, 0,
282
N_("Show warnings after every statement.") },
283
{ "nowarning", 'w', com_nowarnings, 0,
284
N_("Don't show warnings after every statement.") },
513
static Commands commands[] = {
514
Commands( "?", '?', com_help, 0, N_("Synonym for `help'.") ),
515
Commands( "clear", 'c', com_clear, 0, N_("Clear command.")),
516
Commands( "connect",'r', com_connect,1,
517
N_("Reconnect to the server. Optional arguments are db and host.")),
518
Commands( "delimiter", 'd', com_delimiter, 1,
519
N_("Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.") ),
520
Commands( "ego", 'G', com_ego, 0,
521
N_("Send command to drizzle server, display result vertically.")),
522
Commands( "exit", 'q', com_quit, 0, N_("Exit drizzle. Same as quit.")),
523
Commands( "go", 'g', com_go, 0, N_("Send command to drizzle server.") ),
524
Commands( "help", 'h', com_help, 0, N_("Display this help.") ),
525
Commands( "nopager",'n', com_nopager,0, N_("Disable pager, print to stdout.") ),
526
Commands( "notee", 't', com_notee, 0, N_("Don't write into outfile.") ),
527
Commands( "pager", 'P', com_pager, 1,
528
N_("Set PAGER [to_pager]. Print the query results via PAGER.") ),
529
Commands( "print", 'p', com_print, 0, N_("Print current command.") ),
530
Commands( "prompt", 'R', com_prompt, 1, N_("Change your drizzle prompt.")),
531
Commands( "quit", 'q', com_quit, 0, N_("Quit drizzle.") ),
532
Commands( "rehash", '#', com_rehash, 0, N_("Rebuild completion hash.") ),
533
Commands( "source", '.', com_source, 1,
534
N_("Execute an SQL script file. Takes a file name as an argument.")),
535
Commands( "status", 's', com_status, 0, N_("Get status information from the server.")),
536
Commands( "tee", 'T', com_tee, 1,
537
N_("Set outfile [to_outfile]. Append everything into given outfile.") ),
538
Commands( "use", 'u', com_use, 1,
539
N_("Use another schema. Takes schema name as argument.") ),
540
Commands( "shutdown", 'Q', com_shutdown, false,
541
N_("Shutdown the instance you are connected too.") ),
542
Commands( "warnings", 'W', com_warnings, false,
543
N_("Show warnings after every statement.") ),
544
Commands( "nowarning", 'w', com_nowarnings, 0,
545
N_("Don't show warnings after every statement.") ),
285
546
/* Get bash-like expansion for some commands */
286
{ "create table", 0, 0, 0, ""},
287
{ "create database", 0, 0, 0, ""},
288
{ "show databases", 0, 0, 0, ""},
289
{ "show fields from", 0, 0, 0, ""},
290
{ "show keys from", 0, 0, 0, ""},
291
{ "show tables", 0, 0, 0, ""},
292
{ "load data from", 0, 0, 0, ""},
293
{ "alter table", 0, 0, 0, ""},
294
{ "set option", 0, 0, 0, ""},
295
{ "lock tables", 0, 0, 0, ""},
296
{ "unlock tables", 0, 0, 0, ""},
547
Commands( "create table", 0, 0, 0, ""),
548
Commands( "create database", 0, 0, 0, ""),
549
Commands( "show databases", 0, 0, 0, ""),
550
Commands( "show fields from", 0, 0, 0, ""),
551
Commands( "show keys from", 0, 0, 0, ""),
552
Commands( "show tables", 0, 0, 0, ""),
553
Commands( "load data from", 0, 0, 0, ""),
554
Commands( "alter table", 0, 0, 0, ""),
555
Commands( "set option", 0, 0, 0, ""),
556
Commands( "lock tables", 0, 0, 0, ""),
557
Commands( "unlock tables", 0, 0, 0, ""),
297
558
/* generated 2006-12-28. Refresh occasionally from lexer. */
298
{ "ACTION", 0, 0, 0, ""},
299
{ "ADD", 0, 0, 0, ""},
300
{ "AFTER", 0, 0, 0, ""},
301
{ "AGAINST", 0, 0, 0, ""},
302
{ "AGGREGATE", 0, 0, 0, ""},
303
{ "ALL", 0, 0, 0, ""},
304
{ "ALGORITHM", 0, 0, 0, ""},
305
{ "ALTER", 0, 0, 0, ""},
306
{ "ANALYZE", 0, 0, 0, ""},
307
{ "AND", 0, 0, 0, ""},
308
{ "ANY", 0, 0, 0, ""},
309
{ "AS", 0, 0, 0, ""},
310
{ "ASC", 0, 0, 0, ""},
311
{ "ASCII", 0, 0, 0, ""},
312
{ "ASENSITIVE", 0, 0, 0, ""},
313
{ "AUTO_INCREMENT", 0, 0, 0, ""},
314
{ "AVG", 0, 0, 0, ""},
315
{ "AVG_ROW_LENGTH", 0, 0, 0, ""},
316
{ "BACKUP", 0, 0, 0, ""},
317
{ "BDB", 0, 0, 0, ""},
318
{ "BEFORE", 0, 0, 0, ""},
319
{ "BEGIN", 0, 0, 0, ""},
320
{ "BERKELEYDB", 0, 0, 0, ""},
321
{ "BETWEEN", 0, 0, 0, ""},
322
{ "BIGINT", 0, 0, 0, ""},
323
{ "BINARY", 0, 0, 0, ""},
324
{ "BINLOG", 0, 0, 0, ""},
325
{ "BIT", 0, 0, 0, ""},
326
{ "BLOB", 0, 0, 0, ""},
327
{ "BOOL", 0, 0, 0, ""},
328
{ "BOOLEAN", 0, 0, 0, ""},
329
{ "BOTH", 0, 0, 0, ""},
330
{ "BTREE", 0, 0, 0, ""},
331
{ "BY", 0, 0, 0, ""},
332
{ "BYTE", 0, 0, 0, ""},
333
{ "CACHE", 0, 0, 0, ""},
334
{ "CALL", 0, 0, 0, ""},
335
{ "CASCADE", 0, 0, 0, ""},
336
{ "CASCADED", 0, 0, 0, ""},
337
{ "CASE", 0, 0, 0, ""},
338
{ "CHAIN", 0, 0, 0, ""},
339
{ "CHANGE", 0, 0, 0, ""},
340
{ "CHANGED", 0, 0, 0, ""},
341
{ "CHAR", 0, 0, 0, ""},
342
{ "CHARACTER", 0, 0, 0, ""},
343
{ "CHARSET", 0, 0, 0, ""},
344
{ "CHECK", 0, 0, 0, ""},
345
{ "CHECKSUM", 0, 0, 0, ""},
346
{ "CIPHER", 0, 0, 0, ""},
347
{ "CLIENT", 0, 0, 0, ""},
348
{ "CLOSE", 0, 0, 0, ""},
349
{ "CODE", 0, 0, 0, ""},
350
{ "COLLATE", 0, 0, 0, ""},
351
{ "COLLATION", 0, 0, 0, ""},
352
{ "COLUMN", 0, 0, 0, ""},
353
{ "COLUMNS", 0, 0, 0, ""},
354
{ "COMMENT", 0, 0, 0, ""},
355
{ "COMMIT", 0, 0, 0, ""},
356
{ "COMMITTED", 0, 0, 0, ""},
357
{ "COMPACT", 0, 0, 0, ""},
358
{ "COMPRESSED", 0, 0, 0, ""},
359
{ "CONCURRENT", 0, 0, 0, ""},
360
{ "CONDITION", 0, 0, 0, ""},
361
{ "CONNECTION", 0, 0, 0, ""},
362
{ "CONSISTENT", 0, 0, 0, ""},
363
{ "CONSTRAINT", 0, 0, 0, ""},
364
{ "CONTAINS", 0, 0, 0, ""},
365
{ "CONTINUE", 0, 0, 0, ""},
366
{ "CONVERT", 0, 0, 0, ""},
367
{ "CREATE", 0, 0, 0, ""},
368
{ "CROSS", 0, 0, 0, ""},
369
{ "CUBE", 0, 0, 0, ""},
370
{ "CURRENT_DATE", 0, 0, 0, ""},
371
{ "CURRENT_TIME", 0, 0, 0, ""},
372
{ "CURRENT_TIMESTAMP", 0, 0, 0, ""},
373
{ "CURRENT_USER", 0, 0, 0, ""},
374
{ "CURSOR", 0, 0, 0, ""},
375
{ "DATA", 0, 0, 0, ""},
376
{ "DATABASE", 0, 0, 0, ""},
377
{ "DATABASES", 0, 0, 0, ""},
378
{ "DATE", 0, 0, 0, ""},
379
{ "DATETIME", 0, 0, 0, ""},
380
{ "DAY", 0, 0, 0, ""},
381
{ "DAY_HOUR", 0, 0, 0, ""},
382
{ "DAY_MICROSECOND", 0, 0, 0, ""},
383
{ "DAY_MINUTE", 0, 0, 0, ""},
384
{ "DAY_SECOND", 0, 0, 0, ""},
385
{ "DEALLOCATE", 0, 0, 0, ""},
386
{ "DEC", 0, 0, 0, ""},
387
{ "DECIMAL", 0, 0, 0, ""},
388
{ "DECLARE", 0, 0, 0, ""},
389
{ "DEFAULT", 0, 0, 0, ""},
390
{ "DEFINER", 0, 0, 0, ""},
391
{ "DELAYED", 0, 0, 0, ""},
392
{ "DELAY_KEY_WRITE", 0, 0, 0, ""},
393
{ "DELETE", 0, 0, 0, ""},
394
{ "DESC", 0, 0, 0, ""},
395
{ "DESCRIBE", 0, 0, 0, ""},
396
{ "DES_KEY_FILE", 0, 0, 0, ""},
397
{ "DETERMINISTIC", 0, 0, 0, ""},
398
{ "DIRECTORY", 0, 0, 0, ""},
399
{ "DISABLE", 0, 0, 0, ""},
400
{ "DISCARD", 0, 0, 0, ""},
401
{ "DISTINCT", 0, 0, 0, ""},
402
{ "DISTINCTROW", 0, 0, 0, ""},
403
{ "DIV", 0, 0, 0, ""},
404
{ "DO", 0, 0, 0, ""},
405
{ "DOUBLE", 0, 0, 0, ""},
406
{ "DROP", 0, 0, 0, ""},
407
{ "DUAL", 0, 0, 0, ""},
408
{ "DUMPFILE", 0, 0, 0, ""},
409
{ "DUPLICATE", 0, 0, 0, ""},
410
{ "DYNAMIC", 0, 0, 0, ""},
411
{ "EACH", 0, 0, 0, ""},
412
{ "ELSE", 0, 0, 0, ""},
413
{ "ELSEIF", 0, 0, 0, ""},
414
{ "ENABLE", 0, 0, 0, ""},
415
{ "ENCLOSED", 0, 0, 0, ""},
416
{ "END", 0, 0, 0, ""},
417
{ "ENGINE", 0, 0, 0, ""},
418
{ "ENGINES", 0, 0, 0, ""},
419
{ "ENUM", 0, 0, 0, ""},
420
{ "ERRORS", 0, 0, 0, ""},
421
{ "ESCAPE", 0, 0, 0, ""},
422
{ "ESCAPED", 0, 0, 0, ""},
423
{ "EVENTS", 0, 0, 0, ""},
424
{ "EXECUTE", 0, 0, 0, ""},
425
{ "EXISTS", 0, 0, 0, ""},
426
{ "EXIT", 0, 0, 0, ""},
427
{ "EXPANSION", 0, 0, 0, ""},
428
{ "EXPLAIN", 0, 0, 0, ""},
429
{ "EXTENDED", 0, 0, 0, ""},
430
{ "FALSE", 0, 0, 0, ""},
431
{ "FAST", 0, 0, 0, ""},
432
{ "FETCH", 0, 0, 0, ""},
433
{ "FIELDS", 0, 0, 0, ""},
434
{ "FILE", 0, 0, 0, ""},
435
{ "FIRST", 0, 0, 0, ""},
436
{ "FIXED", 0, 0, 0, ""},
437
{ "FLOAT", 0, 0, 0, ""},
438
{ "FLOAT4", 0, 0, 0, ""},
439
{ "FLOAT8", 0, 0, 0, ""},
440
{ "FLUSH", 0, 0, 0, ""},
441
{ "FOR", 0, 0, 0, ""},
442
{ "FORCE", 0, 0, 0, ""},
443
{ "FOREIGN", 0, 0, 0, ""},
444
{ "FOUND", 0, 0, 0, ""},
445
{ "FRAC_SECOND", 0, 0, 0, ""},
446
{ "FROM", 0, 0, 0, ""},
447
{ "FULL", 0, 0, 0, ""},
448
{ "FULLTEXT", 0, 0, 0, ""},
449
{ "FUNCTION", 0, 0, 0, ""},
450
{ "GET_FORMAT", 0, 0, 0, ""},
451
{ "GLOBAL", 0, 0, 0, ""},
452
{ "GRANT", 0, 0, 0, ""},
453
{ "GRANTS", 0, 0, 0, ""},
454
{ "GROUP", 0, 0, 0, ""},
455
{ "HANDLER", 0, 0, 0, ""},
456
{ "HASH", 0, 0, 0, ""},
457
{ "HAVING", 0, 0, 0, ""},
458
{ "HELP", 0, 0, 0, ""},
459
{ "HIGH_PRIORITY", 0, 0, 0, ""},
460
{ "HOSTS", 0, 0, 0, ""},
461
{ "HOUR", 0, 0, 0, ""},
462
{ "HOUR_MICROSECOND", 0, 0, 0, ""},
463
{ "HOUR_MINUTE", 0, 0, 0, ""},
464
{ "HOUR_SECOND", 0, 0, 0, ""},
465
{ "IDENTIFIED", 0, 0, 0, ""},
466
{ "IF", 0, 0, 0, ""},
467
{ "IGNORE", 0, 0, 0, ""},
468
{ "IMPORT", 0, 0, 0, ""},
469
{ "IN", 0, 0, 0, ""},
470
{ "INDEX", 0, 0, 0, ""},
471
{ "INDEXES", 0, 0, 0, ""},
472
{ "INFILE", 0, 0, 0, ""},
473
{ "INNER", 0, 0, 0, ""},
474
{ "INNOBASE", 0, 0, 0, ""},
475
{ "INNODB", 0, 0, 0, ""},
476
{ "INOUT", 0, 0, 0, ""},
477
{ "INSENSITIVE", 0, 0, 0, ""},
478
{ "INSERT", 0, 0, 0, ""},
479
{ "INSERT_METHOD", 0, 0, 0, ""},
480
{ "INT", 0, 0, 0, ""},
481
{ "INT1", 0, 0, 0, ""},
482
{ "INT2", 0, 0, 0, ""},
483
{ "INT3", 0, 0, 0, ""},
484
{ "INT4", 0, 0, 0, ""},
485
{ "INT8", 0, 0, 0, ""},
486
{ "INTEGER", 0, 0, 0, ""},
487
{ "INTERVAL", 0, 0, 0, ""},
488
{ "INTO", 0, 0, 0, ""},
489
{ "IO_THREAD", 0, 0, 0, ""},
490
{ "IS", 0, 0, 0, ""},
491
{ "ISOLATION", 0, 0, 0, ""},
492
{ "ISSUER", 0, 0, 0, ""},
493
{ "ITERATE", 0, 0, 0, ""},
494
{ "INVOKER", 0, 0, 0, ""},
495
{ "JOIN", 0, 0, 0, ""},
496
{ "KEY", 0, 0, 0, ""},
497
{ "KEYS", 0, 0, 0, ""},
498
{ "KILL", 0, 0, 0, ""},
499
{ "LANGUAGE", 0, 0, 0, ""},
500
{ "LAST", 0, 0, 0, ""},
501
{ "LEADING", 0, 0, 0, ""},
502
{ "LEAVE", 0, 0, 0, ""},
503
{ "LEAVES", 0, 0, 0, ""},
504
{ "LEFT", 0, 0, 0, ""},
505
{ "LEVEL", 0, 0, 0, ""},
506
{ "LIKE", 0, 0, 0, ""},
507
{ "LIMIT", 0, 0, 0, ""},
508
{ "LINES", 0, 0, 0, ""},
509
{ "LINESTRING", 0, 0, 0, ""},
510
{ "LOAD", 0, 0, 0, ""},
511
{ "LOCAL", 0, 0, 0, ""},
512
{ "LOCALTIME", 0, 0, 0, ""},
513
{ "LOCALTIMESTAMP", 0, 0, 0, ""},
514
{ "LOCK", 0, 0, 0, ""},
515
{ "LOCKS", 0, 0, 0, ""},
516
{ "LOGS", 0, 0, 0, ""},
517
{ "LONG", 0, 0, 0, ""},
518
{ "LONGTEXT", 0, 0, 0, ""},
519
{ "LOOP", 0, 0, 0, ""},
520
{ "LOW_PRIORITY", 0, 0, 0, ""},
521
{ "MASTER", 0, 0, 0, ""},
522
{ "MASTER_CONNECT_RETRY", 0, 0, 0, ""},
523
{ "MASTER_HOST", 0, 0, 0, ""},
524
{ "MASTER_LOG_FILE", 0, 0, 0, ""},
525
{ "MASTER_LOG_POS", 0, 0, 0, ""},
526
{ "MASTER_PASSWORD", 0, 0, 0, ""},
527
{ "MASTER_PORT", 0, 0, 0, ""},
528
{ "MASTER_SERVER_ID", 0, 0, 0, ""},
529
{ "MASTER_SSL", 0, 0, 0, ""},
530
{ "MASTER_SSL_CA", 0, 0, 0, ""},
531
{ "MASTER_SSL_CAPATH", 0, 0, 0, ""},
532
{ "MASTER_SSL_CERT", 0, 0, 0, ""},
533
{ "MASTER_SSL_CIPHER", 0, 0, 0, ""},
534
{ "MASTER_SSL_KEY", 0, 0, 0, ""},
535
{ "MASTER_USER", 0, 0, 0, ""},
536
{ "MATCH", 0, 0, 0, ""},
537
{ "MAX_CONNECTIONS_PER_HOUR", 0, 0, 0, ""},
538
{ "MAX_QUERIES_PER_HOUR", 0, 0, 0, ""},
539
{ "MAX_ROWS", 0, 0, 0, ""},
540
{ "MAX_UPDATES_PER_HOUR", 0, 0, 0, ""},
541
{ "MAX_USER_CONNECTIONS", 0, 0, 0, ""},
542
{ "MEDIUM", 0, 0, 0, ""},
543
{ "MEDIUMTEXT", 0, 0, 0, ""},
544
{ "MERGE", 0, 0, 0, ""},
545
{ "MICROSECOND", 0, 0, 0, ""},
546
{ "MIDDLEINT", 0, 0, 0, ""},
547
{ "MIGRATE", 0, 0, 0, ""},
548
{ "MINUTE", 0, 0, 0, ""},
549
{ "MINUTE_MICROSECOND", 0, 0, 0, ""},
550
{ "MINUTE_SECOND", 0, 0, 0, ""},
551
{ "MIN_ROWS", 0, 0, 0, ""},
552
{ "MOD", 0, 0, 0, ""},
553
{ "MODE", 0, 0, 0, ""},
554
{ "MODIFIES", 0, 0, 0, ""},
555
{ "MODIFY", 0, 0, 0, ""},
556
{ "MONTH", 0, 0, 0, ""},
557
{ "MULTILINESTRING", 0, 0, 0, ""},
558
{ "MULTIPOINT", 0, 0, 0, ""},
559
{ "MULTIPOLYGON", 0, 0, 0, ""},
560
{ "MUTEX", 0, 0, 0, ""},
561
{ "NAME", 0, 0, 0, ""},
562
{ "NAMES", 0, 0, 0, ""},
563
{ "NATIONAL", 0, 0, 0, ""},
564
{ "NATURAL", 0, 0, 0, ""},
565
{ "NDB", 0, 0, 0, ""},
566
{ "NDBCLUSTER", 0, 0, 0, ""},
567
{ "NCHAR", 0, 0, 0, ""},
568
{ "NEW", 0, 0, 0, ""},
569
{ "NEXT", 0, 0, 0, ""},
570
{ "NO", 0, 0, 0, ""},
571
{ "NONE", 0, 0, 0, ""},
572
{ "NOT", 0, 0, 0, ""},
573
{ "NO_WRITE_TO_BINLOG", 0, 0, 0, ""},
574
{ "NULL", 0, 0, 0, ""},
575
{ "NUMERIC", 0, 0, 0, ""},
576
{ "NVARCHAR", 0, 0, 0, ""},
577
{ "OFFSET", 0, 0, 0, ""},
578
{ "OLD_PASSWORD", 0, 0, 0, ""},
579
{ "ON", 0, 0, 0, ""},
580
{ "ONE", 0, 0, 0, ""},
581
{ "ONE_SHOT", 0, 0, 0, ""},
582
{ "OPEN", 0, 0, 0, ""},
583
{ "OPTIMIZE", 0, 0, 0, ""},
584
{ "OPTION", 0, 0, 0, ""},
585
{ "OPTIONALLY", 0, 0, 0, ""},
586
{ "OR", 0, 0, 0, ""},
587
{ "ORDER", 0, 0, 0, ""},
588
{ "OUT", 0, 0, 0, ""},
589
{ "OUTER", 0, 0, 0, ""},
590
{ "OUTFILE", 0, 0, 0, ""},
591
{ "PACK_KEYS", 0, 0, 0, ""},
592
{ "PARTIAL", 0, 0, 0, ""},
593
{ "PASSWORD", 0, 0, 0, ""},
594
{ "PHASE", 0, 0, 0, ""},
595
{ "POINT", 0, 0, 0, ""},
596
{ "POLYGON", 0, 0, 0, ""},
597
{ "PRECISION", 0, 0, 0, ""},
598
{ "PREPARE", 0, 0, 0, ""},
599
{ "PREV", 0, 0, 0, ""},
600
{ "PRIMARY", 0, 0, 0, ""},
601
{ "PRIVILEGES", 0, 0, 0, ""},
602
{ "PROCEDURE", 0, 0, 0, ""},
603
{ "PROCESS", 0, 0, 0, ""},
604
{ "PROCESSLIST", 0, 0, 0, ""},
605
{ "PURGE", 0, 0, 0, ""},
606
{ "QUARTER", 0, 0, 0, ""},
607
{ "QUERY", 0, 0, 0, ""},
608
{ "QUICK", 0, 0, 0, ""},
609
{ "READ", 0, 0, 0, ""},
610
{ "READS", 0, 0, 0, ""},
611
{ "REAL", 0, 0, 0, ""},
612
{ "RECOVER", 0, 0, 0, ""},
613
{ "REDUNDANT", 0, 0, 0, ""},
614
{ "REFERENCES", 0, 0, 0, ""},
615
{ "REGEXP", 0, 0, 0, ""},
616
{ "RELAY_LOG_FILE", 0, 0, 0, ""},
617
{ "RELAY_LOG_POS", 0, 0, 0, ""},
618
{ "RELAY_THREAD", 0, 0, 0, ""},
619
{ "RELEASE", 0, 0, 0, ""},
620
{ "RELOAD", 0, 0, 0, ""},
621
{ "RENAME", 0, 0, 0, ""},
622
{ "REPAIR", 0, 0, 0, ""},
623
{ "REPEATABLE", 0, 0, 0, ""},
624
{ "REPLACE", 0, 0, 0, ""},
625
{ "REPLICATION", 0, 0, 0, ""},
626
{ "REPEAT", 0, 0, 0, ""},
627
{ "REQUIRE", 0, 0, 0, ""},
628
{ "RESET", 0, 0, 0, ""},
629
{ "RESTORE", 0, 0, 0, ""},
630
{ "RESTRICT", 0, 0, 0, ""},
631
{ "RESUME", 0, 0, 0, ""},
632
{ "RETURN", 0, 0, 0, ""},
633
{ "RETURNS", 0, 0, 0, ""},
634
{ "REVOKE", 0, 0, 0, ""},
635
{ "RIGHT", 0, 0, 0, ""},
636
{ "RLIKE", 0, 0, 0, ""},
637
{ "ROLLBACK", 0, 0, 0, ""},
638
{ "ROLLUP", 0, 0, 0, ""},
639
{ "ROUTINE", 0, 0, 0, ""},
640
{ "ROW", 0, 0, 0, ""},
641
{ "ROWS", 0, 0, 0, ""},
642
{ "ROW_FORMAT", 0, 0, 0, ""},
643
{ "RTREE", 0, 0, 0, ""},
644
{ "SAVEPOINT", 0, 0, 0, ""},
645
{ "SCHEMA", 0, 0, 0, ""},
646
{ "SCHEMAS", 0, 0, 0, ""},
647
{ "SECOND", 0, 0, 0, ""},
648
{ "SECOND_MICROSECOND", 0, 0, 0, ""},
649
{ "SECURITY", 0, 0, 0, ""},
650
{ "SELECT", 0, 0, 0, ""},
651
{ "SENSITIVE", 0, 0, 0, ""},
652
{ "SEPARATOR", 0, 0, 0, ""},
653
{ "SERIAL", 0, 0, 0, ""},
654
{ "SERIALIZABLE", 0, 0, 0, ""},
655
{ "SESSION", 0, 0, 0, ""},
656
{ "SET", 0, 0, 0, ""},
657
{ "SHARE", 0, 0, 0, ""},
658
{ "SHOW", 0, 0, 0, ""},
659
{ "SHUTDOWN", 0, 0, 0, ""},
660
{ "SIGNED", 0, 0, 0, ""},
661
{ "SIMPLE", 0, 0, 0, ""},
662
{ "SLAVE", 0, 0, 0, ""},
663
{ "SNAPSHOT", 0, 0, 0, ""},
664
{ "SMALLINT", 0, 0, 0, ""},
665
{ "SOME", 0, 0, 0, ""},
666
{ "SONAME", 0, 0, 0, ""},
667
{ "SOUNDS", 0, 0, 0, ""},
668
{ "SPATIAL", 0, 0, 0, ""},
669
{ "SPECIFIC", 0, 0, 0, ""},
670
{ "SQL", 0, 0, 0, ""},
671
{ "SQLEXCEPTION", 0, 0, 0, ""},
672
{ "SQLSTATE", 0, 0, 0, ""},
673
{ "SQLWARNING", 0, 0, 0, ""},
674
{ "SQL_BIG_RESULT", 0, 0, 0, ""},
675
{ "SQL_BUFFER_RESULT", 0, 0, 0, ""},
676
{ "SQL_CACHE", 0, 0, 0, ""},
677
{ "SQL_CALC_FOUND_ROWS", 0, 0, 0, ""},
678
{ "SQL_NO_CACHE", 0, 0, 0, ""},
679
{ "SQL_SMALL_RESULT", 0, 0, 0, ""},
680
{ "SQL_THREAD", 0, 0, 0, ""},
681
{ "SQL_TSI_FRAC_SECOND", 0, 0, 0, ""},
682
{ "SQL_TSI_SECOND", 0, 0, 0, ""},
683
{ "SQL_TSI_MINUTE", 0, 0, 0, ""},
684
{ "SQL_TSI_HOUR", 0, 0, 0, ""},
685
{ "SQL_TSI_DAY", 0, 0, 0, ""},
686
{ "SQL_TSI_WEEK", 0, 0, 0, ""},
687
{ "SQL_TSI_MONTH", 0, 0, 0, ""},
688
{ "SQL_TSI_QUARTER", 0, 0, 0, ""},
689
{ "SQL_TSI_YEAR", 0, 0, 0, ""},
690
{ "SSL", 0, 0, 0, ""},
691
{ "START", 0, 0, 0, ""},
692
{ "STARTING", 0, 0, 0, ""},
693
{ "STATUS", 0, 0, 0, ""},
694
{ "STOP", 0, 0, 0, ""},
695
{ "STORAGE", 0, 0, 0, ""},
696
{ "STRAIGHT_JOIN", 0, 0, 0, ""},
697
{ "STRING", 0, 0, 0, ""},
698
{ "STRIPED", 0, 0, 0, ""},
699
{ "SUBJECT", 0, 0, 0, ""},
700
{ "SUPER", 0, 0, 0, ""},
701
{ "SUSPEND", 0, 0, 0, ""},
702
{ "TABLE", 0, 0, 0, ""},
703
{ "TABLES", 0, 0, 0, ""},
704
{ "TABLESPACE", 0, 0, 0, ""},
705
{ "TEMPORARY", 0, 0, 0, ""},
706
{ "TEMPTABLE", 0, 0, 0, ""},
707
{ "TERMINATED", 0, 0, 0, ""},
708
{ "TEXT", 0, 0, 0, ""},
709
{ "THEN", 0, 0, 0, ""},
710
{ "TIME", 0, 0, 0, ""},
711
{ "TIMESTAMP", 0, 0, 0, ""},
712
{ "TIMESTAMPADD", 0, 0, 0, ""},
713
{ "TIMESTAMPDIFF", 0, 0, 0, ""},
714
{ "TINYINT", 0, 0, 0, ""},
715
{ "TINYTEXT", 0, 0, 0, ""},
716
{ "TO", 0, 0, 0, ""},
717
{ "TRAILING", 0, 0, 0, ""},
718
{ "TRANSACTION", 0, 0, 0, ""},
719
{ "TRIGGER", 0, 0, 0, ""},
720
{ "TRIGGERS", 0, 0, 0, ""},
721
{ "TRUE", 0, 0, 0, ""},
722
{ "TRUNCATE", 0, 0, 0, ""},
723
{ "TYPE", 0, 0, 0, ""},
724
{ "TYPES", 0, 0, 0, ""},
725
{ "UNCOMMITTED", 0, 0, 0, ""},
726
{ "UNDEFINED", 0, 0, 0, ""},
727
{ "UNDO", 0, 0, 0, ""},
728
{ "UNICODE", 0, 0, 0, ""},
729
{ "UNION", 0, 0, 0, ""},
730
{ "UNIQUE", 0, 0, 0, ""},
731
{ "UNKNOWN", 0, 0, 0, ""},
732
{ "UNLOCK", 0, 0, 0, ""},
733
{ "UNSIGNED", 0, 0, 0, ""},
734
{ "UNTIL", 0, 0, 0, ""},
735
{ "UPDATE", 0, 0, 0, ""},
736
{ "UPGRADE", 0, 0, 0, ""},
737
{ "USAGE", 0, 0, 0, ""},
738
{ "USE", 0, 0, 0, ""},
739
{ "USER", 0, 0, 0, ""},
740
{ "USER_RESOURCES", 0, 0, 0, ""},
741
{ "USE_FRM", 0, 0, 0, ""},
742
{ "USING", 0, 0, 0, ""},
743
{ "UTC_DATE", 0, 0, 0, ""},
744
{ "UTC_TIME", 0, 0, 0, ""},
745
{ "UTC_TIMESTAMP", 0, 0, 0, ""},
746
{ "VALUE", 0, 0, 0, ""},
747
{ "VALUES", 0, 0, 0, ""},
748
{ "VARBINARY", 0, 0, 0, ""},
749
{ "VARCHAR", 0, 0, 0, ""},
750
{ "VARCHARACTER", 0, 0, 0, ""},
751
{ "VARIABLES", 0, 0, 0, ""},
752
{ "VARYING", 0, 0, 0, ""},
753
{ "WARNINGS", 0, 0, 0, ""},
754
{ "WEEK", 0, 0, 0, ""},
755
{ "WHEN", 0, 0, 0, ""},
756
{ "WHERE", 0, 0, 0, ""},
757
{ "WHILE", 0, 0, 0, ""},
758
{ "VIEW", 0, 0, 0, ""},
759
{ "WITH", 0, 0, 0, ""},
760
{ "WORK", 0, 0, 0, ""},
761
{ "WRITE", 0, 0, 0, ""},
762
{ "X509", 0, 0, 0, ""},
763
{ "XOR", 0, 0, 0, ""},
764
{ "XA", 0, 0, 0, ""},
765
{ "YEAR", 0, 0, 0, ""},
766
{ "YEAR_MONTH", 0, 0, 0, ""},
767
{ "ZEROFILL", 0, 0, 0, ""},
768
{ "ABS", 0, 0, 0, ""},
769
{ "ACOS", 0, 0, 0, ""},
770
{ "ADDDATE", 0, 0, 0, ""},
771
{ "ADDTIME", 0, 0, 0, ""},
772
{ "AES_ENCRYPT", 0, 0, 0, ""},
773
{ "AES_DECRYPT", 0, 0, 0, ""},
774
{ "AREA", 0, 0, 0, ""},
775
{ "ASIN", 0, 0, 0, ""},
776
{ "ASBINARY", 0, 0, 0, ""},
777
{ "ASTEXT", 0, 0, 0, ""},
778
{ "ASWKB", 0, 0, 0, ""},
779
{ "ASWKT", 0, 0, 0, ""},
780
{ "ATAN", 0, 0, 0, ""},
781
{ "ATAN2", 0, 0, 0, ""},
782
{ "BENCHMARK", 0, 0, 0, ""},
783
{ "BIN", 0, 0, 0, ""},
784
{ "BIT_COUNT", 0, 0, 0, ""},
785
{ "BIT_OR", 0, 0, 0, ""},
786
{ "BIT_AND", 0, 0, 0, ""},
787
{ "BIT_XOR", 0, 0, 0, ""},
788
{ "CAST", 0, 0, 0, ""},
789
{ "CEIL", 0, 0, 0, ""},
790
{ "CEILING", 0, 0, 0, ""},
791
{ "BIT_LENGTH", 0, 0, 0, ""},
792
{ "CENTROID", 0, 0, 0, ""},
793
{ "CHAR_LENGTH", 0, 0, 0, ""},
794
{ "CHARACTER_LENGTH", 0, 0, 0, ""},
795
{ "COALESCE", 0, 0, 0, ""},
796
{ "COERCIBILITY", 0, 0, 0, ""},
797
{ "COMPRESS", 0, 0, 0, ""},
798
{ "CONCAT", 0, 0, 0, ""},
799
{ "CONCAT_WS", 0, 0, 0, ""},
800
{ "CONNECTION_ID", 0, 0, 0, ""},
801
{ "CONV", 0, 0, 0, ""},
802
{ "CONVERT_TZ", 0, 0, 0, ""},
803
{ "COUNT", 0, 0, 0, ""},
804
{ "COS", 0, 0, 0, ""},
805
{ "COT", 0, 0, 0, ""},
806
{ "CRC32", 0, 0, 0, ""},
807
{ "CROSSES", 0, 0, 0, ""},
808
{ "CURDATE", 0, 0, 0, ""},
809
{ "CURTIME", 0, 0, 0, ""},
810
{ "DATE_ADD", 0, 0, 0, ""},
811
{ "DATEDIFF", 0, 0, 0, ""},
812
{ "DATE_FORMAT", 0, 0, 0, ""},
813
{ "DATE_SUB", 0, 0, 0, ""},
814
{ "DAYNAME", 0, 0, 0, ""},
815
{ "DAYOFMONTH", 0, 0, 0, ""},
816
{ "DAYOFWEEK", 0, 0, 0, ""},
817
{ "DAYOFYEAR", 0, 0, 0, ""},
818
{ "DECODE", 0, 0, 0, ""},
819
{ "DEGREES", 0, 0, 0, ""},
820
{ "DES_ENCRYPT", 0, 0, 0, ""},
821
{ "DES_DECRYPT", 0, 0, 0, ""},
822
{ "DIMENSION", 0, 0, 0, ""},
823
{ "DISJOINT", 0, 0, 0, ""},
824
{ "ELT", 0, 0, 0, ""},
825
{ "ENCODE", 0, 0, 0, ""},
826
{ "ENCRYPT", 0, 0, 0, ""},
827
{ "ENDPOINT", 0, 0, 0, ""},
828
{ "ENVELOPE", 0, 0, 0, ""},
829
{ "EQUALS", 0, 0, 0, ""},
830
{ "EXTERIORRING", 0, 0, 0, ""},
831
{ "EXTRACT", 0, 0, 0, ""},
832
{ "EXP", 0, 0, 0, ""},
833
{ "EXPORT_SET", 0, 0, 0, ""},
834
{ "FIELD", 0, 0, 0, ""},
835
{ "FIND_IN_SET", 0, 0, 0, ""},
836
{ "FLOOR", 0, 0, 0, ""},
837
{ "FORMAT", 0, 0, 0, ""},
838
{ "FOUND_ROWS", 0, 0, 0, ""},
839
{ "FROM_DAYS", 0, 0, 0, ""},
840
{ "FROM_UNIXTIME", 0, 0, 0, ""},
841
{ "GET_LOCK", 0, 0, 0, ""},
842
{ "GLENGTH", 0, 0, 0, ""},
843
{ "GREATEST", 0, 0, 0, ""},
844
{ "GROUP_CONCAT", 0, 0, 0, ""},
845
{ "GROUP_UNIQUE_USERS", 0, 0, 0, ""},
846
{ "HEX", 0, 0, 0, ""},
847
{ "IFNULL", 0, 0, 0, ""},
848
{ "INET_ATON", 0, 0, 0, ""},
849
{ "INET_NTOA", 0, 0, 0, ""},
850
{ "INSTR", 0, 0, 0, ""},
851
{ "INTERIORRINGN", 0, 0, 0, ""},
852
{ "INTERSECTS", 0, 0, 0, ""},
853
{ "ISCLOSED", 0, 0, 0, ""},
854
{ "ISEMPTY", 0, 0, 0, ""},
855
{ "ISNULL", 0, 0, 0, ""},
856
{ "IS_FREE_LOCK", 0, 0, 0, ""},
857
{ "IS_USED_LOCK", 0, 0, 0, ""},
858
{ "LAST_INSERT_ID", 0, 0, 0, ""},
859
{ "ISSIMPLE", 0, 0, 0, ""},
860
{ "LAST_DAY", 0, 0, 0, ""},
861
{ "LCASE", 0, 0, 0, ""},
862
{ "LEAST", 0, 0, 0, ""},
863
{ "LENGTH", 0, 0, 0, ""},
864
{ "LN", 0, 0, 0, ""},
865
{ "LINEFROMTEXT", 0, 0, 0, ""},
866
{ "LINEFROMWKB", 0, 0, 0, ""},
867
{ "LINESTRINGFROMTEXT", 0, 0, 0, ""},
868
{ "LINESTRINGFROMWKB", 0, 0, 0, ""},
869
{ "LOAD_FILE", 0, 0, 0, ""},
870
{ "LOCATE", 0, 0, 0, ""},
871
{ "LOG", 0, 0, 0, ""},
872
{ "LOG2", 0, 0, 0, ""},
873
{ "LOG10", 0, 0, 0, ""},
874
{ "LOWER", 0, 0, 0, ""},
875
{ "LPAD", 0, 0, 0, ""},
876
{ "LTRIM", 0, 0, 0, ""},
877
{ "MAKE_SET", 0, 0, 0, ""},
878
{ "MAKEDATE", 0, 0, 0, ""},
879
{ "MAKETIME", 0, 0, 0, ""},
880
{ "MASTER_POS_WAIT", 0, 0, 0, ""},
881
{ "MAX", 0, 0, 0, ""},
882
{ "MBRCONTAINS", 0, 0, 0, ""},
883
{ "MBRDISJOINT", 0, 0, 0, ""},
884
{ "MBREQUAL", 0, 0, 0, ""},
885
{ "MBRINTERSECTS", 0, 0, 0, ""},
886
{ "MBROVERLAPS", 0, 0, 0, ""},
887
{ "MBRTOUCHES", 0, 0, 0, ""},
888
{ "MBRWITHIN", 0, 0, 0, ""},
889
{ "MD5", 0, 0, 0, ""},
890
{ "MID", 0, 0, 0, ""},
891
{ "MIN", 0, 0, 0, ""},
892
{ "MLINEFROMTEXT", 0, 0, 0, ""},
893
{ "MLINEFROMWKB", 0, 0, 0, ""},
894
{ "MPOINTFROMTEXT", 0, 0, 0, ""},
895
{ "MPOINTFROMWKB", 0, 0, 0, ""},
896
{ "MPOLYFROMTEXT", 0, 0, 0, ""},
897
{ "MPOLYFROMWKB", 0, 0, 0, ""},
898
{ "MONTHNAME", 0, 0, 0, ""},
899
{ "MULTILINESTRINGFROMTEXT", 0, 0, 0, ""},
900
{ "MULTILINESTRINGFROMWKB", 0, 0, 0, ""},
901
{ "MULTIPOINTFROMTEXT", 0, 0, 0, ""},
902
{ "MULTIPOINTFROMWKB", 0, 0, 0, ""},
903
{ "MULTIPOLYGONFROMTEXT", 0, 0, 0, ""},
904
{ "MULTIPOLYGONFROMWKB", 0, 0, 0, ""},
905
{ "NAME_CONST", 0, 0, 0, ""},
906
{ "NOW", 0, 0, 0, ""},
907
{ "NULLIF", 0, 0, 0, ""},
908
{ "NUMINTERIORRINGS", 0, 0, 0, ""},
909
{ "NUMPOINTS", 0, 0, 0, ""},
910
{ "OCTET_LENGTH", 0, 0, 0, ""},
911
{ "OCT", 0, 0, 0, ""},
912
{ "ORD", 0, 0, 0, ""},
913
{ "OVERLAPS", 0, 0, 0, ""},
914
{ "PERIOD_ADD", 0, 0, 0, ""},
915
{ "PERIOD_DIFF", 0, 0, 0, ""},
916
{ "PI", 0, 0, 0, ""},
917
{ "POINTFROMTEXT", 0, 0, 0, ""},
918
{ "POINTFROMWKB", 0, 0, 0, ""},
919
{ "POINTN", 0, 0, 0, ""},
920
{ "POLYFROMTEXT", 0, 0, 0, ""},
921
{ "POLYFROMWKB", 0, 0, 0, ""},
922
{ "POLYGONFROMTEXT", 0, 0, 0, ""},
923
{ "POLYGONFROMWKB", 0, 0, 0, ""},
924
{ "POSITION", 0, 0, 0, ""},
925
{ "POW", 0, 0, 0, ""},
926
{ "POWER", 0, 0, 0, ""},
927
{ "QUOTE", 0, 0, 0, ""},
928
{ "RADIANS", 0, 0, 0, ""},
929
{ "RAND", 0, 0, 0, ""},
930
{ "RELEASE_LOCK", 0, 0, 0, ""},
931
{ "REVERSE", 0, 0, 0, ""},
932
{ "ROUND", 0, 0, 0, ""},
933
{ "ROW_COUNT", 0, 0, 0, ""},
934
{ "RPAD", 0, 0, 0, ""},
935
{ "RTRIM", 0, 0, 0, ""},
936
{ "SEC_TO_TIME", 0, 0, 0, ""},
937
{ "SESSION_USER", 0, 0, 0, ""},
938
{ "SUBDATE", 0, 0, 0, ""},
939
{ "SIGN", 0, 0, 0, ""},
940
{ "SIN", 0, 0, 0, ""},
941
{ "SHA", 0, 0, 0, ""},
942
{ "SHA1", 0, 0, 0, ""},
943
{ "SLEEP", 0, 0, 0, ""},
944
{ "SOUNDEX", 0, 0, 0, ""},
945
{ "SPACE", 0, 0, 0, ""},
946
{ "SQRT", 0, 0, 0, ""},
947
{ "SRID", 0, 0, 0, ""},
948
{ "STARTPOINT", 0, 0, 0, ""},
949
{ "STD", 0, 0, 0, ""},
950
{ "STDDEV", 0, 0, 0, ""},
951
{ "STDDEV_POP", 0, 0, 0, ""},
952
{ "STDDEV_SAMP", 0, 0, 0, ""},
953
{ "STR_TO_DATE", 0, 0, 0, ""},
954
{ "STRCMP", 0, 0, 0, ""},
955
{ "SUBSTR", 0, 0, 0, ""},
956
{ "SUBSTRING", 0, 0, 0, ""},
957
{ "SUBSTRING_INDEX", 0, 0, 0, ""},
958
{ "SUBTIME", 0, 0, 0, ""},
959
{ "SUM", 0, 0, 0, ""},
960
{ "SYSDATE", 0, 0, 0, ""},
961
{ "SYSTEM_USER", 0, 0, 0, ""},
962
{ "TAN", 0, 0, 0, ""},
963
{ "TIME_FORMAT", 0, 0, 0, ""},
964
{ "TIME_TO_SEC", 0, 0, 0, ""},
965
{ "TIMEDIFF", 0, 0, 0, ""},
966
{ "TO_DAYS", 0, 0, 0, ""},
967
{ "TOUCHES", 0, 0, 0, ""},
968
{ "TRIM", 0, 0, 0, ""},
969
{ "UCASE", 0, 0, 0, ""},
970
{ "UNCOMPRESS", 0, 0, 0, ""},
971
{ "UNCOMPRESSED_LENGTH", 0, 0, 0, ""},
972
{ "UNHEX", 0, 0, 0, ""},
973
{ "UNIQUE_USERS", 0, 0, 0, ""},
974
{ "UNIX_TIMESTAMP", 0, 0, 0, ""},
975
{ "UPPER", 0, 0, 0, ""},
976
{ "UUID", 0, 0, 0, ""},
977
{ "VARIANCE", 0, 0, 0, ""},
978
{ "VAR_POP", 0, 0, 0, ""},
979
{ "VAR_SAMP", 0, 0, 0, ""},
980
{ "VERSION", 0, 0, 0, ""},
981
{ "WEEKDAY", 0, 0, 0, ""},
982
{ "WEEKOFYEAR", 0, 0, 0, ""},
983
{ "WITHIN", 0, 0, 0, ""},
986
{ "YEARWEEK", 0, 0, 0, ""},
559
Commands( "ACTION", 0, 0, 0, ""),
560
Commands( "ADD", 0, 0, 0, ""),
561
Commands( "AFTER", 0, 0, 0, ""),
562
Commands( "AGAINST", 0, 0, 0, ""),
563
Commands( "AGGREGATE", 0, 0, 0, ""),
564
Commands( "ALL", 0, 0, 0, ""),
565
Commands( "ALGORITHM", 0, 0, 0, ""),
566
Commands( "ALTER", 0, 0, 0, ""),
567
Commands( "ANALYZE", 0, 0, 0, ""),
568
Commands( "AND", 0, 0, 0, ""),
569
Commands( "ANY", 0, 0, 0, ""),
570
Commands( "AS", 0, 0, 0, ""),
571
Commands( "ASC", 0, 0, 0, ""),
572
Commands( "ASCII", 0, 0, 0, ""),
573
Commands( "ASENSITIVE", 0, 0, 0, ""),
574
Commands( "AUTO_INCREMENT", 0, 0, 0, ""),
575
Commands( "AVG", 0, 0, 0, ""),
576
Commands( "AVG_ROW_LENGTH", 0, 0, 0, ""),
577
Commands( "BEFORE", 0, 0, 0, ""),
578
Commands( "BEGIN", 0, 0, 0, ""),
579
Commands( "BETWEEN", 0, 0, 0, ""),
580
Commands( "BIGINT", 0, 0, 0, ""),
581
Commands( "BINARY", 0, 0, 0, ""),
582
Commands( "BIT", 0, 0, 0, ""),
583
Commands( "BLOB", 0, 0, 0, ""),
584
Commands( "BOOL", 0, 0, 0, ""),
585
Commands( "BOOLEAN", 0, 0, 0, ""),
586
Commands( "BOTH", 0, 0, 0, ""),
587
Commands( "BTREE", 0, 0, 0, ""),
588
Commands( "BY", 0, 0, 0, ""),
589
Commands( "BYTE", 0, 0, 0, ""),
590
Commands( "CACHE", 0, 0, 0, ""),
591
Commands( "CALL", 0, 0, 0, ""),
592
Commands( "CASCADE", 0, 0, 0, ""),
593
Commands( "CASCADED", 0, 0, 0, ""),
594
Commands( "CASE", 0, 0, 0, ""),
595
Commands( "CHAIN", 0, 0, 0, ""),
596
Commands( "CHANGE", 0, 0, 0, ""),
597
Commands( "CHANGED", 0, 0, 0, ""),
598
Commands( "CHAR", 0, 0, 0, ""),
599
Commands( "CHARACTER", 0, 0, 0, ""),
600
Commands( "CHECK", 0, 0, 0, ""),
601
Commands( "CHECKSUM", 0, 0, 0, ""),
602
Commands( "CLIENT", 0, 0, 0, ""),
603
Commands( "CLOSE", 0, 0, 0, ""),
604
Commands( "COLLATE", 0, 0, 0, ""),
605
Commands( "COLLATION", 0, 0, 0, ""),
606
Commands( "COLUMN", 0, 0, 0, ""),
607
Commands( "COLUMNS", 0, 0, 0, ""),
608
Commands( "COMMENT", 0, 0, 0, ""),
609
Commands( "COMMIT", 0, 0, 0, ""),
610
Commands( "COMMITTED", 0, 0, 0, ""),
611
Commands( "COMPACT", 0, 0, 0, ""),
612
Commands( "COMPRESSED", 0, 0, 0, ""),
613
Commands( "CONCURRENT", 0, 0, 0, ""),
614
Commands( "CONDITION", 0, 0, 0, ""),
615
Commands( "CONNECTION", 0, 0, 0, ""),
616
Commands( "CONSISTENT", 0, 0, 0, ""),
617
Commands( "CONSTRAINT", 0, 0, 0, ""),
618
Commands( "CONTAINS", 0, 0, 0, ""),
619
Commands( "CONTINUE", 0, 0, 0, ""),
620
Commands( "CONVERT", 0, 0, 0, ""),
621
Commands( "CREATE", 0, 0, 0, ""),
622
Commands( "CROSS", 0, 0, 0, ""),
623
Commands( "CUBE", 0, 0, 0, ""),
624
Commands( "CURRENT_DATE", 0, 0, 0, ""),
625
Commands( "CURRENT_TIMESTAMP", 0, 0, 0, ""),
626
Commands( "CURRENT_USER", 0, 0, 0, ""),
627
Commands( "CURSOR", 0, 0, 0, ""),
628
Commands( "DATA", 0, 0, 0, ""),
629
Commands( "DATABASE", 0, 0, 0, ""),
630
Commands( "DATABASES", 0, 0, 0, ""),
631
Commands( "DATE", 0, 0, 0, ""),
632
Commands( "DATETIME", 0, 0, 0, ""),
633
Commands( "DAY", 0, 0, 0, ""),
634
Commands( "DAY_HOUR", 0, 0, 0, ""),
635
Commands( "DAY_MICROSECOND", 0, 0, 0, ""),
636
Commands( "DAY_MINUTE", 0, 0, 0, ""),
637
Commands( "DAY_SECOND", 0, 0, 0, ""),
638
Commands( "DEALLOCATE", 0, 0, 0, ""),
639
Commands( "DEC", 0, 0, 0, ""),
640
Commands( "DECIMAL", 0, 0, 0, ""),
641
Commands( "DECLARE", 0, 0, 0, ""),
642
Commands( "DEFAULT", 0, 0, 0, ""),
643
Commands( "DEFINER", 0, 0, 0, ""),
644
Commands( "DELAYED", 0, 0, 0, ""),
645
Commands( "DELETE", 0, 0, 0, ""),
646
Commands( "DESC", 0, 0, 0, ""),
647
Commands( "DESCRIBE", 0, 0, 0, ""),
648
Commands( "DETERMINISTIC", 0, 0, 0, ""),
649
Commands( "DISABLE", 0, 0, 0, ""),
650
Commands( "DISCARD", 0, 0, 0, ""),
651
Commands( "DISTINCT", 0, 0, 0, ""),
652
Commands( "DISTINCTROW", 0, 0, 0, ""),
653
Commands( "DIV", 0, 0, 0, ""),
654
Commands( "DOUBLE", 0, 0, 0, ""),
655
Commands( "DROP", 0, 0, 0, ""),
656
Commands( "DUMPFILE", 0, 0, 0, ""),
657
Commands( "DUPLICATE", 0, 0, 0, ""),
658
Commands( "DYNAMIC", 0, 0, 0, ""),
659
Commands( "EACH", 0, 0, 0, ""),
660
Commands( "ELSE", 0, 0, 0, ""),
661
Commands( "ELSEIF", 0, 0, 0, ""),
662
Commands( "ENABLE", 0, 0, 0, ""),
663
Commands( "ENCLOSED", 0, 0, 0, ""),
664
Commands( "END", 0, 0, 0, ""),
665
Commands( "ENGINE", 0, 0, 0, ""),
666
Commands( "ENGINES", 0, 0, 0, ""),
667
Commands( "ENUM", 0, 0, 0, ""),
668
Commands( "ERRORS", 0, 0, 0, ""),
669
Commands( "ESCAPE", 0, 0, 0, ""),
670
Commands( "ESCAPED", 0, 0, 0, ""),
671
Commands( "EXISTS", 0, 0, 0, ""),
672
Commands( "EXIT", 0, 0, 0, ""),
673
Commands( "EXPLAIN", 0, 0, 0, ""),
674
Commands( "EXTENDED", 0, 0, 0, ""),
675
Commands( "FALSE", 0, 0, 0, ""),
676
Commands( "FAST", 0, 0, 0, ""),
677
Commands( "FETCH", 0, 0, 0, ""),
678
Commands( "FIELDS", 0, 0, 0, ""),
679
Commands( "FILE", 0, 0, 0, ""),
680
Commands( "FIRST", 0, 0, 0, ""),
681
Commands( "FIXED", 0, 0, 0, ""),
682
Commands( "FLOAT", 0, 0, 0, ""),
683
Commands( "FLOAT4", 0, 0, 0, ""),
684
Commands( "FLOAT8", 0, 0, 0, ""),
685
Commands( "FLUSH", 0, 0, 0, ""),
686
Commands( "FOR", 0, 0, 0, ""),
687
Commands( "FORCE", 0, 0, 0, ""),
688
Commands( "FOREIGN", 0, 0, 0, ""),
689
Commands( "FOUND", 0, 0, 0, ""),
690
Commands( "FRAC_SECOND", 0, 0, 0, ""),
691
Commands( "FROM", 0, 0, 0, ""),
692
Commands( "FULL", 0, 0, 0, ""),
693
Commands( "FUNCTION", 0, 0, 0, ""),
694
Commands( "GLOBAL", 0, 0, 0, ""),
695
Commands( "GRANT", 0, 0, 0, ""),
696
Commands( "GRANTS", 0, 0, 0, ""),
697
Commands( "GROUP", 0, 0, 0, ""),
698
Commands( "HANDLER", 0, 0, 0, ""),
699
Commands( "HASH", 0, 0, 0, ""),
700
Commands( "HAVING", 0, 0, 0, ""),
701
Commands( "HELP", 0, 0, 0, ""),
702
Commands( "HIGH_PRIORITY", 0, 0, 0, ""),
703
Commands( "HOSTS", 0, 0, 0, ""),
704
Commands( "HOUR", 0, 0, 0, ""),
705
Commands( "HOUR_MICROSECOND", 0, 0, 0, ""),
706
Commands( "HOUR_MINUTE", 0, 0, 0, ""),
707
Commands( "HOUR_SECOND", 0, 0, 0, ""),
708
Commands( "IDENTIFIED", 0, 0, 0, ""),
709
Commands( "IF", 0, 0, 0, ""),
710
Commands( "IGNORE", 0, 0, 0, ""),
711
Commands( "IMPORT", 0, 0, 0, ""),
712
Commands( "IN", 0, 0, 0, ""),
713
Commands( "INDEX", 0, 0, 0, ""),
714
Commands( "INDEXES", 0, 0, 0, ""),
715
Commands( "INFILE", 0, 0, 0, ""),
716
Commands( "INNER", 0, 0, 0, ""),
717
Commands( "INNOBASE", 0, 0, 0, ""),
718
Commands( "INNODB", 0, 0, 0, ""),
719
Commands( "INOUT", 0, 0, 0, ""),
720
Commands( "INSENSITIVE", 0, 0, 0, ""),
721
Commands( "INSERT", 0, 0, 0, ""),
722
Commands( "INSERT_METHOD", 0, 0, 0, ""),
723
Commands( "INT", 0, 0, 0, ""),
724
Commands( "INT1", 0, 0, 0, ""),
725
Commands( "INT2", 0, 0, 0, ""),
726
Commands( "INT3", 0, 0, 0, ""),
727
Commands( "INT4", 0, 0, 0, ""),
728
Commands( "INT8", 0, 0, 0, ""),
729
Commands( "INTEGER", 0, 0, 0, ""),
730
Commands( "INTERVAL", 0, 0, 0, ""),
731
Commands( "INTO", 0, 0, 0, ""),
732
Commands( "IO_THREAD", 0, 0, 0, ""),
733
Commands( "IS", 0, 0, 0, ""),
734
Commands( "ISOLATION", 0, 0, 0, ""),
735
Commands( "ISSUER", 0, 0, 0, ""),
736
Commands( "ITERATE", 0, 0, 0, ""),
737
Commands( "INVOKER", 0, 0, 0, ""),
738
Commands( "JOIN", 0, 0, 0, ""),
739
Commands( "KEY", 0, 0, 0, ""),
740
Commands( "KEYS", 0, 0, 0, ""),
741
Commands( "KILL", 0, 0, 0, ""),
742
Commands( "LANGUAGE", 0, 0, 0, ""),
743
Commands( "LAST", 0, 0, 0, ""),
744
Commands( "LEADING", 0, 0, 0, ""),
745
Commands( "LEAVE", 0, 0, 0, ""),
746
Commands( "LEAVES", 0, 0, 0, ""),
747
Commands( "LEFT", 0, 0, 0, ""),
748
Commands( "LEVEL", 0, 0, 0, ""),
749
Commands( "LIKE", 0, 0, 0, ""),
750
Commands( "LIMIT", 0, 0, 0, ""),
751
Commands( "LINES", 0, 0, 0, ""),
752
Commands( "LINESTRING", 0, 0, 0, ""),
753
Commands( "LOAD", 0, 0, 0, ""),
754
Commands( "LOCAL", 0, 0, 0, ""),
755
Commands( "LOCALTIMESTAMP", 0, 0, 0, ""),
756
Commands( "LOCK", 0, 0, 0, ""),
757
Commands( "LOCKS", 0, 0, 0, ""),
758
Commands( "LOGS", 0, 0, 0, ""),
759
Commands( "LONG", 0, 0, 0, ""),
760
Commands( "LOOP", 0, 0, 0, ""),
761
Commands( "MATCH", 0, 0, 0, ""),
762
Commands( "MAX_CONNECTIONS_PER_HOUR", 0, 0, 0, ""),
763
Commands( "MAX_QUERIES_PER_HOUR", 0, 0, 0, ""),
764
Commands( "MAX_ROWS", 0, 0, 0, ""),
765
Commands( "MAX_UPDATES_PER_HOUR", 0, 0, 0, ""),
766
Commands( "MAX_USER_CONNECTIONS", 0, 0, 0, ""),
767
Commands( "MEDIUM", 0, 0, 0, ""),
768
Commands( "MERGE", 0, 0, 0, ""),
769
Commands( "MICROSECOND", 0, 0, 0, ""),
770
Commands( "MIGRATE", 0, 0, 0, ""),
771
Commands( "MINUTE", 0, 0, 0, ""),
772
Commands( "MINUTE_MICROSECOND", 0, 0, 0, ""),
773
Commands( "MINUTE_SECOND", 0, 0, 0, ""),
774
Commands( "MIN_ROWS", 0, 0, 0, ""),
775
Commands( "MOD", 0, 0, 0, ""),
776
Commands( "MODE", 0, 0, 0, ""),
777
Commands( "MODIFIES", 0, 0, 0, ""),
778
Commands( "MODIFY", 0, 0, 0, ""),
779
Commands( "MONTH", 0, 0, 0, ""),
780
Commands( "MULTILINESTRING", 0, 0, 0, ""),
781
Commands( "MULTIPOINT", 0, 0, 0, ""),
782
Commands( "MULTIPOLYGON", 0, 0, 0, ""),
783
Commands( "MUTEX", 0, 0, 0, ""),
784
Commands( "NAME", 0, 0, 0, ""),
785
Commands( "NAMES", 0, 0, 0, ""),
786
Commands( "NATIONAL", 0, 0, 0, ""),
787
Commands( "NATURAL", 0, 0, 0, ""),
788
Commands( "NCHAR", 0, 0, 0, ""),
789
Commands( "NEW", 0, 0, 0, ""),
790
Commands( "NEXT", 0, 0, 0, ""),
791
Commands( "NO", 0, 0, 0, ""),
792
Commands( "NONE", 0, 0, 0, ""),
793
Commands( "NOT", 0, 0, 0, ""),
794
Commands( "NULL", 0, 0, 0, ""),
795
Commands( "NUMERIC", 0, 0, 0, ""),
796
Commands( "NVARCHAR", 0, 0, 0, ""),
797
Commands( "OFFSET", 0, 0, 0, ""),
798
Commands( "ON", 0, 0, 0, ""),
799
Commands( "ONE", 0, 0, 0, ""),
800
Commands( "ONE_SHOT", 0, 0, 0, ""),
801
Commands( "OPEN", 0, 0, 0, ""),
802
Commands( "OPTIMIZE", 0, 0, 0, ""),
803
Commands( "OPTION", 0, 0, 0, ""),
804
Commands( "OPTIONALLY", 0, 0, 0, ""),
805
Commands( "OR", 0, 0, 0, ""),
806
Commands( "ORDER", 0, 0, 0, ""),
807
Commands( "OUT", 0, 0, 0, ""),
808
Commands( "OUTER", 0, 0, 0, ""),
809
Commands( "OUTFILE", 0, 0, 0, ""),
810
Commands( "PACK_KEYS", 0, 0, 0, ""),
811
Commands( "PARTIAL", 0, 0, 0, ""),
812
Commands( "PASSWORD", 0, 0, 0, ""),
813
Commands( "PHASE", 0, 0, 0, ""),
814
Commands( "PRECISION", 0, 0, 0, ""),
815
Commands( "PREPARE", 0, 0, 0, ""),
816
Commands( "PREV", 0, 0, 0, ""),
817
Commands( "PRIMARY", 0, 0, 0, ""),
818
Commands( "PRIVILEGES", 0, 0, 0, ""),
819
Commands( "PROCEDURE", 0, 0, 0, ""),
820
Commands( "PROCESS", 0, 0, 0, ""),
821
Commands( "PROCESSLIST", 0, 0, 0, ""),
822
Commands( "PURGE", 0, 0, 0, ""),
823
Commands( "QUARTER", 0, 0, 0, ""),
824
Commands( "QUERY", 0, 0, 0, ""),
825
Commands( "QUICK", 0, 0, 0, ""),
826
Commands( "READ", 0, 0, 0, ""),
827
Commands( "READS", 0, 0, 0, ""),
828
Commands( "REAL", 0, 0, 0, ""),
829
Commands( "RECOVER", 0, 0, 0, ""),
830
Commands( "REDUNDANT", 0, 0, 0, ""),
831
Commands( "REFERENCES", 0, 0, 0, ""),
832
Commands( "REGEXP", 0, 0, 0, ""),
833
Commands( "RELEASE", 0, 0, 0, ""),
834
Commands( "RELOAD", 0, 0, 0, ""),
835
Commands( "RENAME", 0, 0, 0, ""),
836
Commands( "REPAIR", 0, 0, 0, ""),
837
Commands( "REPEATABLE", 0, 0, 0, ""),
838
Commands( "REPLACE", 0, 0, 0, ""),
839
Commands( "REPEAT", 0, 0, 0, ""),
840
Commands( "REQUIRE", 0, 0, 0, ""),
841
Commands( "RESET", 0, 0, 0, ""),
842
Commands( "RESTORE", 0, 0, 0, ""),
843
Commands( "RESTRICT", 0, 0, 0, ""),
844
Commands( "RESUME", 0, 0, 0, ""),
845
Commands( "RETURN", 0, 0, 0, ""),
846
Commands( "RETURNS", 0, 0, 0, ""),
847
Commands( "REVOKE", 0, 0, 0, ""),
848
Commands( "RIGHT", 0, 0, 0, ""),
849
Commands( "RLIKE", 0, 0, 0, ""),
850
Commands( "ROLLBACK", 0, 0, 0, ""),
851
Commands( "ROLLUP", 0, 0, 0, ""),
852
Commands( "ROUTINE", 0, 0, 0, ""),
853
Commands( "ROW", 0, 0, 0, ""),
854
Commands( "ROWS", 0, 0, 0, ""),
855
Commands( "ROW_FORMAT", 0, 0, 0, ""),
856
Commands( "RTREE", 0, 0, 0, ""),
857
Commands( "SAVEPOINT", 0, 0, 0, ""),
858
Commands( "SCHEMA", 0, 0, 0, ""),
859
Commands( "SCHEMAS", 0, 0, 0, ""),
860
Commands( "SECOND", 0, 0, 0, ""),
861
Commands( "SECOND_MICROSECOND", 0, 0, 0, ""),
862
Commands( "SECURITY", 0, 0, 0, ""),
863
Commands( "SELECT", 0, 0, 0, ""),
864
Commands( "SENSITIVE", 0, 0, 0, ""),
865
Commands( "SEPARATOR", 0, 0, 0, ""),
866
Commands( "SERIAL", 0, 0, 0, ""),
867
Commands( "SERIALIZABLE", 0, 0, 0, ""),
868
Commands( "SESSION", 0, 0, 0, ""),
869
Commands( "SET", 0, 0, 0, ""),
870
Commands( "SHARE", 0, 0, 0, ""),
871
Commands( "SHOW", 0, 0, 0, ""),
872
Commands( "SHUTDOWN", 0, 0, 0, ""),
873
Commands( "SIGNED", 0, 0, 0, ""),
874
Commands( "SIMPLE", 0, 0, 0, ""),
875
Commands( "SLAVE", 0, 0, 0, ""),
876
Commands( "SNAPSHOT", 0, 0, 0, ""),
877
Commands( "SOME", 0, 0, 0, ""),
878
Commands( "SONAME", 0, 0, 0, ""),
879
Commands( "SOUNDS", 0, 0, 0, ""),
880
Commands( "SPATIAL", 0, 0, 0, ""),
881
Commands( "SPECIFIC", 0, 0, 0, ""),
882
Commands( "SQL", 0, 0, 0, ""),
883
Commands( "SQLEXCEPTION", 0, 0, 0, ""),
884
Commands( "SQLSTATE", 0, 0, 0, ""),
885
Commands( "SQLWARNING", 0, 0, 0, ""),
886
Commands( "SQL_BIG_RESULT", 0, 0, 0, ""),
887
Commands( "SQL_BUFFER_RESULT", 0, 0, 0, ""),
888
Commands( "SQL_CACHE", 0, 0, 0, ""),
889
Commands( "SQL_CALC_FOUND_ROWS", 0, 0, 0, ""),
890
Commands( "SQL_NO_CACHE", 0, 0, 0, ""),
891
Commands( "SQL_SMALL_RESULT", 0, 0, 0, ""),
892
Commands( "SQL_THREAD", 0, 0, 0, ""),
893
Commands( "SQL_TSI_FRAC_SECOND", 0, 0, 0, ""),
894
Commands( "SQL_TSI_SECOND", 0, 0, 0, ""),
895
Commands( "SQL_TSI_MINUTE", 0, 0, 0, ""),
896
Commands( "SQL_TSI_HOUR", 0, 0, 0, ""),
897
Commands( "SQL_TSI_DAY", 0, 0, 0, ""),
898
Commands( "SQL_TSI_WEEK", 0, 0, 0, ""),
899
Commands( "SQL_TSI_MONTH", 0, 0, 0, ""),
900
Commands( "SQL_TSI_QUARTER", 0, 0, 0, ""),
901
Commands( "SQL_TSI_YEAR", 0, 0, 0, ""),
902
Commands( "SSL", 0, 0, 0, ""),
903
Commands( "START", 0, 0, 0, ""),
904
Commands( "STARTING", 0, 0, 0, ""),
905
Commands( "STATUS", 0, 0, 0, ""),
906
Commands( "STOP", 0, 0, 0, ""),
907
Commands( "STORAGE", 0, 0, 0, ""),
908
Commands( "STRAIGHT_JOIN", 0, 0, 0, ""),
909
Commands( "STRING", 0, 0, 0, ""),
910
Commands( "STRIPED", 0, 0, 0, ""),
911
Commands( "SUBJECT", 0, 0, 0, ""),
912
Commands( "SUPER", 0, 0, 0, ""),
913
Commands( "SUSPEND", 0, 0, 0, ""),
914
Commands( "TABLE", 0, 0, 0, ""),
915
Commands( "TABLES", 0, 0, 0, ""),
916
Commands( "TABLESPACE", 0, 0, 0, ""),
917
Commands( "TEMPORARY", 0, 0, 0, ""),
918
Commands( "TEMPTABLE", 0, 0, 0, ""),
919
Commands( "TERMINATED", 0, 0, 0, ""),
920
Commands( "TEXT", 0, 0, 0, ""),
921
Commands( "THEN", 0, 0, 0, ""),
922
Commands( "TIMESTAMP", 0, 0, 0, ""),
923
Commands( "TIMESTAMPADD", 0, 0, 0, ""),
924
Commands( "TIMESTAMPDIFF", 0, 0, 0, ""),
925
Commands( "TO", 0, 0, 0, ""),
926
Commands( "TRAILING", 0, 0, 0, ""),
927
Commands( "TRANSACTION", 0, 0, 0, ""),
928
Commands( "TRUE", 0, 0, 0, ""),
929
Commands( "TRUNCATE", 0, 0, 0, ""),
930
Commands( "TYPE", 0, 0, 0, ""),
931
Commands( "TYPES", 0, 0, 0, ""),
932
Commands( "UNCOMMITTED", 0, 0, 0, ""),
933
Commands( "UNDEFINED", 0, 0, 0, ""),
934
Commands( "UNDO", 0, 0, 0, ""),
935
Commands( "UNICODE", 0, 0, 0, ""),
936
Commands( "UNION", 0, 0, 0, ""),
937
Commands( "UNIQUE", 0, 0, 0, ""),
938
Commands( "UNKNOWN", 0, 0, 0, ""),
939
Commands( "UNLOCK", 0, 0, 0, ""),
940
Commands( "UNTIL", 0, 0, 0, ""),
941
Commands( "UPDATE", 0, 0, 0, ""),
942
Commands( "UPGRADE", 0, 0, 0, ""),
943
Commands( "USAGE", 0, 0, 0, ""),
944
Commands( "USE", 0, 0, 0, ""),
945
Commands( "USER", 0, 0, 0, ""),
946
Commands( "USER_RESOURCES", 0, 0, 0, ""),
947
Commands( "USING", 0, 0, 0, ""),
948
Commands( "UTC_DATE", 0, 0, 0, ""),
949
Commands( "UTC_TIMESTAMP", 0, 0, 0, ""),
950
Commands( "VALUE", 0, 0, 0, ""),
951
Commands( "VALUES", 0, 0, 0, ""),
952
Commands( "VARBINARY", 0, 0, 0, ""),
953
Commands( "VARCHAR", 0, 0, 0, ""),
954
Commands( "VARCHARACTER", 0, 0, 0, ""),
955
Commands( "VARIABLES", 0, 0, 0, ""),
956
Commands( "VARYING", 0, 0, 0, ""),
957
Commands( "WARNINGS", 0, 0, 0, ""),
958
Commands( "WEEK", 0, 0, 0, ""),
959
Commands( "WHEN", 0, 0, 0, ""),
960
Commands( "WHERE", 0, 0, 0, ""),
961
Commands( "WHILE", 0, 0, 0, ""),
962
Commands( "VIEW", 0, 0, 0, ""),
963
Commands( "WITH", 0, 0, 0, ""),
964
Commands( "WORK", 0, 0, 0, ""),
965
Commands( "WRITE", 0, 0, 0, ""),
966
Commands( "XOR", 0, 0, 0, ""),
967
Commands( "XA", 0, 0, 0, ""),
968
Commands( "YEAR", 0, 0, 0, ""),
969
Commands( "YEAR_MONTH", 0, 0, 0, ""),
970
Commands( "ZEROFILL", 0, 0, 0, ""),
971
Commands( "ABS", 0, 0, 0, ""),
972
Commands( "ACOS", 0, 0, 0, ""),
973
Commands( "ADDDATE", 0, 0, 0, ""),
974
Commands( "AREA", 0, 0, 0, ""),
975
Commands( "ASIN", 0, 0, 0, ""),
976
Commands( "ASBINARY", 0, 0, 0, ""),
977
Commands( "ASTEXT", 0, 0, 0, ""),
978
Commands( "ATAN", 0, 0, 0, ""),
979
Commands( "ATAN2", 0, 0, 0, ""),
980
Commands( "BENCHMARK", 0, 0, 0, ""),
981
Commands( "BIN", 0, 0, 0, ""),
982
Commands( "BIT_OR", 0, 0, 0, ""),
983
Commands( "BIT_AND", 0, 0, 0, ""),
984
Commands( "BIT_XOR", 0, 0, 0, ""),
985
Commands( "CAST", 0, 0, 0, ""),
986
Commands( "CEIL", 0, 0, 0, ""),
987
Commands( "CEILING", 0, 0, 0, ""),
988
Commands( "CENTROID", 0, 0, 0, ""),
989
Commands( "CHAR_LENGTH", 0, 0, 0, ""),
990
Commands( "CHARACTER_LENGTH", 0, 0, 0, ""),
991
Commands( "COALESCE", 0, 0, 0, ""),
992
Commands( "COERCIBILITY", 0, 0, 0, ""),
993
Commands( "COMPRESS", 0, 0, 0, ""),
994
Commands( "CONCAT", 0, 0, 0, ""),
995
Commands( "CONCAT_WS", 0, 0, 0, ""),
996
Commands( "CONNECTION_ID", 0, 0, 0, ""),
997
Commands( "CONV", 0, 0, 0, ""),
998
Commands( "CONVERT_TZ", 0, 0, 0, ""),
999
Commands( "COUNT", 0, 0, 0, ""),
1000
Commands( "COS", 0, 0, 0, ""),
1001
Commands( "COT", 0, 0, 0, ""),
1002
Commands( "CRC32", 0, 0, 0, ""),
1003
Commands( "CROSSES", 0, 0, 0, ""),
1004
Commands( "CURDATE", 0, 0, 0, ""),
1005
Commands( "DATE_ADD", 0, 0, 0, ""),
1006
Commands( "DATEDIFF", 0, 0, 0, ""),
1007
Commands( "DATE_FORMAT", 0, 0, 0, ""),
1008
Commands( "DATE_SUB", 0, 0, 0, ""),
1009
Commands( "DAYNAME", 0, 0, 0, ""),
1010
Commands( "DAYOFMONTH", 0, 0, 0, ""),
1011
Commands( "DAYOFWEEK", 0, 0, 0, ""),
1012
Commands( "DAYOFYEAR", 0, 0, 0, ""),
1013
Commands( "DECODE", 0, 0, 0, ""),
1014
Commands( "DEGREES", 0, 0, 0, ""),
1015
Commands( "DES_ENCRYPT", 0, 0, 0, ""),
1016
Commands( "DES_DECRYPT", 0, 0, 0, ""),
1017
Commands( "DIMENSION", 0, 0, 0, ""),
1018
Commands( "DISJOINT", 0, 0, 0, ""),
1019
Commands( "ELT", 0, 0, 0, ""),
1020
Commands( "ENCODE", 0, 0, 0, ""),
1021
Commands( "ENCRYPT", 0, 0, 0, ""),
1022
Commands( "ENDPOINT", 0, 0, 0, ""),
1023
Commands( "ENVELOPE", 0, 0, 0, ""),
1024
Commands( "EQUALS", 0, 0, 0, ""),
1025
Commands( "EXTERIORRING", 0, 0, 0, ""),
1026
Commands( "EXTRACT", 0, 0, 0, ""),
1027
Commands( "EXP", 0, 0, 0, ""),
1028
Commands( "EXPORT_SET", 0, 0, 0, ""),
1029
Commands( "FIELD", 0, 0, 0, ""),
1030
Commands( "FIND_IN_SET", 0, 0, 0, ""),
1031
Commands( "FLOOR", 0, 0, 0, ""),
1032
Commands( "FORMAT", 0, 0, 0, ""),
1033
Commands( "FOUND_ROWS", 0, 0, 0, ""),
1034
Commands( "FROM_DAYS", 0, 0, 0, ""),
1035
Commands( "FROM_UNIXTIME", 0, 0, 0, ""),
1036
Commands( "GET_LOCK", 0, 0, 0, ""),
1037
Commands( "GLENGTH", 0, 0, 0, ""),
1038
Commands( "GREATEST", 0, 0, 0, ""),
1039
Commands( "GROUP_CONCAT", 0, 0, 0, ""),
1040
Commands( "GROUP_UNIQUE_USERS", 0, 0, 0, ""),
1041
Commands( "HEX", 0, 0, 0, ""),
1042
Commands( "IFNULL", 0, 0, 0, ""),
1043
Commands( "INSTR", 0, 0, 0, ""),
1044
Commands( "INTERIORRINGN", 0, 0, 0, ""),
1045
Commands( "INTERSECTS", 0, 0, 0, ""),
1046
Commands( "ISCLOSED", 0, 0, 0, ""),
1047
Commands( "ISEMPTY", 0, 0, 0, ""),
1048
Commands( "ISNULL", 0, 0, 0, ""),
1049
Commands( "IS_FREE_LOCK", 0, 0, 0, ""),
1050
Commands( "IS_USED_LOCK", 0, 0, 0, ""),
1051
Commands( "LAST_INSERT_ID", 0, 0, 0, ""),
1052
Commands( "ISSIMPLE", 0, 0, 0, ""),
1053
Commands( "LAST_DAY", 0, 0, 0, ""),
1054
Commands( "LCASE", 0, 0, 0, ""),
1055
Commands( "LEAST", 0, 0, 0, ""),
1056
Commands( "LENGTH", 0, 0, 0, ""),
1057
Commands( "LN", 0, 0, 0, ""),
1058
Commands( "LOAD_FILE", 0, 0, 0, ""),
1059
Commands( "LOCATE", 0, 0, 0, ""),
1060
Commands( "LOG", 0, 0, 0, ""),
1061
Commands( "LOG2", 0, 0, 0, ""),
1062
Commands( "LOG10", 0, 0, 0, ""),
1063
Commands( "LOWER", 0, 0, 0, ""),
1064
Commands( "LPAD", 0, 0, 0, ""),
1065
Commands( "LTRIM", 0, 0, 0, ""),
1066
Commands( "MAKE_SET", 0, 0, 0, ""),
1067
Commands( "MAKEDATE", 0, 0, 0, ""),
1068
Commands( "MASTER_POS_WAIT", 0, 0, 0, ""),
1069
Commands( "MAX", 0, 0, 0, ""),
1070
Commands( "MBRCONTAINS", 0, 0, 0, ""),
1071
Commands( "MBRDISJOINT", 0, 0, 0, ""),
1072
Commands( "MBREQUAL", 0, 0, 0, ""),
1073
Commands( "MBRINTERSECTS", 0, 0, 0, ""),
1074
Commands( "MBROVERLAPS", 0, 0, 0, ""),
1075
Commands( "MBRTOUCHES", 0, 0, 0, ""),
1076
Commands( "MBRWITHIN", 0, 0, 0, ""),
1077
Commands( "MD5", 0, 0, 0, ""),
1078
Commands( "MID", 0, 0, 0, ""),
1079
Commands( "MIN", 0, 0, 0, ""),
1080
Commands( "MONTHNAME", 0, 0, 0, ""),
1081
Commands( "NAME_CONST", 0, 0, 0, ""),
1082
Commands( "NOW", 0, 0, 0, ""),
1083
Commands( "NULLIF", 0, 0, 0, ""),
1084
Commands( "NUMPOINTS", 0, 0, 0, ""),
1085
Commands( "OCTET_LENGTH", 0, 0, 0, ""),
1086
Commands( "OCT", 0, 0, 0, ""),
1087
Commands( "ORD", 0, 0, 0, ""),
1088
Commands( "OVERLAPS", 0, 0, 0, ""),
1089
Commands( "PERIOD_ADD", 0, 0, 0, ""),
1090
Commands( "PERIOD_DIFF", 0, 0, 0, ""),
1091
Commands( "PI", 0, 0, 0, ""),
1092
Commands( "POINTN", 0, 0, 0, ""),
1093
Commands( "POSITION", 0, 0, 0, ""),
1094
Commands( "POW", 0, 0, 0, ""),
1095
Commands( "POWER", 0, 0, 0, ""),
1096
Commands( "QUOTE", 0, 0, 0, ""),
1097
Commands( "RADIANS", 0, 0, 0, ""),
1098
Commands( "RAND", 0, 0, 0, ""),
1099
Commands( "RELEASE_LOCK", 0, 0, 0, ""),
1100
Commands( "REVERSE", 0, 0, 0, ""),
1101
Commands( "ROUND", 0, 0, 0, ""),
1102
Commands( "ROW_COUNT", 0, 0, 0, ""),
1103
Commands( "RPAD", 0, 0, 0, ""),
1104
Commands( "RTRIM", 0, 0, 0, ""),
1105
Commands( "SESSION_USER", 0, 0, 0, ""),
1106
Commands( "SUBDATE", 0, 0, 0, ""),
1107
Commands( "SIGN", 0, 0, 0, ""),
1108
Commands( "SIN", 0, 0, 0, ""),
1109
Commands( "SHA", 0, 0, 0, ""),
1110
Commands( "SHA1", 0, 0, 0, ""),
1111
Commands( "SLEEP", 0, 0, 0, ""),
1112
Commands( "SOUNDEX", 0, 0, 0, ""),
1113
Commands( "SPACE", 0, 0, 0, ""),
1114
Commands( "SQRT", 0, 0, 0, ""),
1115
Commands( "SRID", 0, 0, 0, ""),
1116
Commands( "STARTPOINT", 0, 0, 0, ""),
1117
Commands( "STD", 0, 0, 0, ""),
1118
Commands( "STDDEV", 0, 0, 0, ""),
1119
Commands( "STDDEV_POP", 0, 0, 0, ""),
1120
Commands( "STDDEV_SAMP", 0, 0, 0, ""),
1121
Commands( "STR_TO_DATE", 0, 0, 0, ""),
1122
Commands( "STRCMP", 0, 0, 0, ""),
1123
Commands( "SUBSTR", 0, 0, 0, ""),
1124
Commands( "SUBSTRING", 0, 0, 0, ""),
1125
Commands( "SUBSTRING_INDEX", 0, 0, 0, ""),
1126
Commands( "SUM", 0, 0, 0, ""),
1127
Commands( "SYSDATE", 0, 0, 0, ""),
1128
Commands( "SYSTEM_USER", 0, 0, 0, ""),
1129
Commands( "TAN", 0, 0, 0, ""),
1130
Commands( "TIME_FORMAT", 0, 0, 0, ""),
1131
Commands( "TO_DAYS", 0, 0, 0, ""),
1132
Commands( "TOUCHES", 0, 0, 0, ""),
1133
Commands( "TRIM", 0, 0, 0, ""),
1134
Commands( "UCASE", 0, 0, 0, ""),
1135
Commands( "UNCOMPRESS", 0, 0, 0, ""),
1136
Commands( "UNCOMPRESSED_LENGTH", 0, 0, 0, ""),
1137
Commands( "UNHEX", 0, 0, 0, ""),
1138
Commands( "UNIQUE_USERS", 0, 0, 0, ""),
1139
Commands( "UNIX_TIMESTAMP", 0, 0, 0, ""),
1140
Commands( "UPPER", 0, 0, 0, ""),
1141
Commands( "UUID", 0, 0, 0, ""),
1142
Commands( "VARIANCE", 0, 0, 0, ""),
1143
Commands( "VAR_POP", 0, 0, 0, ""),
1144
Commands( "VAR_SAMP", 0, 0, 0, ""),
1145
Commands( "VERSION", 0, 0, 0, ""),
1146
Commands( "WEEKDAY", 0, 0, 0, ""),
1147
Commands( "WEEKOFYEAR", 0, 0, 0, ""),
1148
Commands( "WITHIN", 0, 0, 0, ""),
1149
Commands( "X", 0, 0, 0, ""),
1150
Commands( "Y", 0, 0, 0, ""),
1151
Commands( "YEARWEEK", 0, 0, 0, ""),
987
1152
/* end sentinel */
988
{ (char *)NULL, 0, 0, 0, ""}
1153
Commands((char *)NULL, 0, 0, 0, "")
991
static const char *load_default_groups[]= { "drizzle","client",0 };
993
1157
int history_length;
994
1158
static int not_in_history(const char *line);
995
1159
static void initialize_readline (char *name);
996
1160
static void fix_history(string *final_command);
998
static COMMANDS *find_command(const char *name,char cmd_name);
1162
static Commands *find_command(const char *name,char cmd_name);
999
1163
static bool add_line(string *buffer,char *line,char *in_string,
1000
1164
bool *ml_comment);
1001
1165
static void remove_cntrl(string *buffer);
1002
static void print_table_data(DRIZZLE_RES *result);
1003
static void print_tab_data(DRIZZLE_RES *result);
1004
static void print_table_data_vertically(DRIZZLE_RES *result);
1005
static void print_warnings(void);
1006
static uint32_t start_timer(void);
1007
static void end_timer(uint32_t start_time,char *buff);
1008
static void drizzle_end_timer(uint32_t start_time,char *buff);
1009
static void nice_time(double sec,char *buff,bool part_second);
1010
extern "C" RETSIGTYPE drizzle_end(int sig);
1011
extern "C" RETSIGTYPE handle_sigint(int sig);
1166
static void print_table_data(drizzle_result_st *result);
1167
static void print_tab_data(drizzle_result_st *result);
1168
static void print_table_data_vertically(drizzle_result_st *result);
1169
static void print_warnings(uint32_t error_code);
1170
static boost::posix_time::ptime start_timer(void);
1171
static void end_timer(boost::posix_time::ptime, string &buff);
1172
static void drizzle_end_timer(boost::posix_time::ptime, string &buff);
1173
static void nice_time(boost::posix_time::time_duration duration, string &buff);
1174
extern "C" void drizzle_end(int sig);
1175
extern "C" void handle_sigint(int sig);
1012
1176
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
1013
static RETSIGTYPE window_resize(int sig);
1177
static void window_resize(int sig);
1181
Shutdown the server that we are currently connected to.
1188
static bool server_shutdown(void)
1190
drizzle_result_st result;
1191
drizzle_return_t ret;
1195
printf(_("shutting down drizzled"));
1196
if (opt_drizzle_port > 0)
1197
printf(_(" on port %d"), opt_drizzle_port);
1201
if (drizzle_shutdown(&con, &result, DRIZZLE_SHUTDOWN_DEFAULT,
1202
&ret) == NULL || ret != DRIZZLE_RETURN_OK)
1204
if (ret == DRIZZLE_RETURN_ERROR_CODE)
1206
fprintf(stderr, _("shutdown failed; error: '%s'"),
1207
drizzle_result_error(&result));
1208
drizzle_result_free(&result);
1212
fprintf(stderr, _("shutdown failed; error: '%s'"),
1213
drizzle_con_error(&con));
1218
drizzle_result_free(&result);
1221
printf(_("done\n"));
1226
static bool kill_query(uint32_t query_id)
1228
drizzle_result_st result;
1229
drizzle_return_t ret;
1233
printf(_("killing query %u"), query_id);
1237
if (drizzle_kill(&con, &result, query_id,
1238
&ret) == NULL || ret != DRIZZLE_RETURN_OK)
1240
if (ret == DRIZZLE_RETURN_ERROR_CODE)
1242
fprintf(stderr, _("kill failed; error: '%s'"),
1243
drizzle_result_error(&result));
1244
drizzle_result_free(&result);
1248
fprintf(stderr, _("kill failed; error: '%s'"),
1249
drizzle_con_error(&con));
1254
drizzle_result_free(&result);
1257
printf(_("done\n"));
1263
Ping the server that we are currently connected to.
1270
static bool server_ping(void)
1272
drizzle_result_st result;
1273
drizzle_return_t ret;
1275
if (drizzle_ping(&con, &result, &ret) != NULL && ret == DRIZZLE_RETURN_OK)
1278
printf(_("drizzled is alive\n"));
1282
if (ret == DRIZZLE_RETURN_ERROR_CODE)
1284
fprintf(stderr, _("ping failed; error: '%s'"),
1285
drizzle_result_error(&result));
1286
drizzle_result_free(&result);
1290
fprintf(stderr, _("drizzled won't answer to ping, error: '%s'"),
1291
drizzle_con_error(&con));
1295
drizzle_result_free(&result);
1300
Execute command(s) specified by the user.
1302
@param error error status of command execution.
1303
If an error had occurred, this variable will be set
1304
to 1 whereas on success, it shall be set to 0. This
1305
value will be supplied to the exit() function used
1309
false no commands were executed
1311
true at least one command was executed
1313
static bool execute_commands(int *error)
1315
bool executed= false;
1320
if (server_ping() == false)
1327
if (server_shutdown() == false)
1334
if (kill_query(opt_kill) == false)
1344
static void check_timeout_value(uint32_t in_connect_timeout)
1346
opt_connect_timeout= 0;
1347
if (in_connect_timeout > 3600*12)
1349
cout << _("Error: Invalid Value for connect_timeout");
1352
opt_connect_timeout= in_connect_timeout;
1355
static void check_max_input_line(uint32_t in_max_input_line)
1357
opt_max_input_line= 0;
1358
if (in_max_input_line < 4096 || in_max_input_line > (int64_t)2*1024L*1024L*1024L)
1360
cout << _("Error: Invalid Value for max_input_line");
1363
opt_max_input_line= in_max_input_line - (in_max_input_line % 1024);
1016
1366
int main(int argc,char *argv[])
1020
1371
#if defined(ENABLE_NLS)
1021
1372
# if defined(HAVE_LOCALE_H)
1022
1373
setlocale(LC_ALL, "");
1024
bindtextdomain("drizzle", LOCALEDIR);
1025
textdomain("drizzle");
1375
bindtextdomain("drizzle7", LOCALEDIR);
1376
textdomain("drizzle7");
1029
delimiter_str= delimiter;
1030
default_prompt= my_strdup(getenv("DRIZZLE_PS1") ?
1031
getenv("DRIZZLE_PS1") :
1032
"drizzle>> ", MYF(0));
1033
current_prompt= my_strdup(default_prompt, MYF(0));
1379
po::options_description commandline_options(_("Options used only in command line"));
1380
commandline_options.add_options()
1381
("help,?",_("Displays this help and exit."))
1382
("batch,B",_("Don't use history file. Disable interactive behavior. (Enables --silent)"))
1383
("column-type-info", po::value<bool>(&column_types_flag)->default_value(false)->zero_tokens(),
1384
_("Display column type information."))
1385
("comments,c", po::value<bool>(&preserve_comments)->default_value(false)->zero_tokens(),
1386
_("Preserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments"))
1387
("vertical,E", po::value<bool>(&vertical)->default_value(false)->zero_tokens(),
1388
_("Print the output of a query (rows) vertically."))
1389
("force,f", po::value<bool>(&ignore_errors)->default_value(false)->zero_tokens(),
1390
_("Continue even if we get an sql error."))
1391
("named-commands,G", po::value<bool>(&named_cmds)->default_value(false)->zero_tokens(),
1392
_("Enable named commands. Named commands mean this program's internal commands; see drizzle> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter."))
1393
("no-beep,b", po::value<bool>(&opt_nobeep)->default_value(false)->zero_tokens(),
1394
_("Turn off beep on error."))
1395
("disable-line-numbers", _("Do not write line numbers for errors."))
1396
("disable-column-names", _("Do not write column names in results."))
1397
("skip-column-names,N",
1398
_("Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead."))
1399
("set-variable,O", po::value<string>(),
1400
_("Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value."))
1401
("table,t", po::value<bool>(&output_tables)->default_value(false)->zero_tokens(),
1402
_("Output in table format."))
1403
("safe-updates,U", po::value<bool>(&safe_updates)->default_value(false)->zero_tokens(),
1404
_("Only allow UPDATE and DELETE that uses keys."))
1405
("i-am-a-dummy,U", po::value<bool>(&safe_updates)->default_value(false)->zero_tokens(),
1406
_("Synonym for option --safe-updates, -U."))
1407
("verbose,v", po::value<string>(&opt_verbose)->default_value(""),
1408
_("-v vvv implies that verbose= 3, Used to specify verbose"))
1409
("version,V", _("Output version information and exit."))
1410
("secure-auth", po::value<bool>(&opt_secure_auth)->default_value(false)->zero_tokens(),
1411
_("Refuse client connecting to server if it uses old (pre-4.1.1) protocol"))
1412
("show-warnings", po::value<bool>(&show_warnings)->default_value(false)->zero_tokens(),
1413
_("Show warnings after every statement."))
1414
("show-progress-size", po::value<uint32_t>(&show_progress_size)->default_value(0),
1415
_("Number of lines before each import progress report."))
1416
("ping", po::value<bool>(&opt_ping)->default_value(false)->zero_tokens(),
1417
_("Ping the server to check if it's alive."))
1418
("no-defaults", po::value<bool>()->default_value(false)->zero_tokens(),
1419
_("Configuration file defaults are not used if no-defaults is set"))
1422
po::options_description drizzle_options(_("Options specific to the drizzle client"));
1423
drizzle_options.add_options()
1424
("disable-auto-rehash,A",
1425
_("Disable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time."))
1426
("auto-vertical-output", po::value<bool>(&auto_vertical_output)->default_value(false)->zero_tokens(),
1427
_("Automatically switch to vertical output mode if the result is wider than the terminal width."))
1428
("database,D", po::value<string>(¤t_db)->default_value(""),
1429
_("Database to use."))
1430
("default-character-set",po::value<string>(),
1432
("delimiter", po::value<string>(&delimiter_str)->default_value(";"),
1433
_("Delimiter to be used."))
1434
("execute,e", po::value<string>(),
1435
_("Execute command and quit. (Disables --force and history file)"))
1436
("local-infile", po::value<bool>(&opt_local_infile)->default_value(false)->zero_tokens(),
1437
_("Enable LOAD DATA LOCAL INFILE."))
1438
("unbuffered,n", po::value<bool>(&unbuffered)->default_value(false)->zero_tokens(),
1439
_("Flush buffer after each query."))
1440
("sigint-ignore", po::value<bool>(&opt_sigint_ignore)->default_value(false)->zero_tokens(),
1441
_("Ignore SIGINT (CTRL-C)"))
1442
("one-database,o", po::value<bool>(&one_database)->default_value(false)->zero_tokens(),
1443
_("Only update the default database. This is useful for skipping updates to other database in the update log."))
1444
("pager", po::value<string>(),
1445
_("Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default."))
1446
("disable-pager", po::value<bool>(&opt_nopager)->default_value(false)->zero_tokens(),
1447
_("Disable pager and print to stdout. See interactive help (\\h) also."))
1448
("prompt", po::value<string>(¤t_prompt)->default_value(""),
1449
_("Set the drizzle prompt to this value."))
1450
("quick,q", po::value<bool>(&quick)->default_value(false)->zero_tokens(),
1451
_("Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file."))
1452
("raw,r", po::value<bool>(&opt_raw_data)->default_value(false)->zero_tokens(),
1453
_("Write fields without conversion. Used with --batch."))
1454
("disable-reconnect", _("Do not reconnect if the connection is lost."))
1455
("shutdown", po::value<bool>()->zero_tokens(),
1456
_("Shutdown the server"))
1457
("silent,s", _("Be more silent. Print results with a tab as separator, each row on new line."))
1458
("kill", po::value<uint32_t>(&opt_kill)->default_value(0),
1459
_("Kill a running query."))
1460
("tee", po::value<string>(),
1461
_("Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default."))
1462
("disable-tee", po::value<bool>()->default_value(false)->zero_tokens(),
1463
_("Disable outfile. See interactive help (\\h) also."))
1464
("connect-timeout", po::value<uint32_t>(&opt_connect_timeout)->default_value(0)->notifier(&check_timeout_value),
1465
_("Number of seconds before connection timeout."))
1466
("max-input-line", po::value<uint32_t>(&opt_max_input_line)->default_value(16*1024L*1024L)->notifier(&check_max_input_line),
1467
_("Max length of input line"))
1468
("select-limit", po::value<uint32_t>(&select_limit)->default_value(1000L),
1469
_("Automatic limit for SELECT when using --safe-updates"))
1470
("max-join-size", po::value<uint32_t>(&max_join_size)->default_value(1000000L),
1471
_("Automatic limit for rows in a join when using --safe-updates"))
1474
po::options_description client_options(_("Options specific to the client"));
1475
client_options.add_options()
1476
("host,h", po::value<string>(¤t_host)->default_value("localhost"),
1477
_("Connect to host"))
1478
("password,P", po::value<string>(¤t_password)->default_value(PASSWORD_SENTINEL),
1479
_("Password to use when connecting to server. If password is not given it's asked from the tty."))
1480
("port,p", po::value<uint32_t>()->default_value(0),
1481
_("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default"))
1482
("user,u", po::value<string>(¤t_user)->default_value(UserDetect().getUser()),
1483
_("User for login if not current user."))
1484
("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
1485
_("The protocol of connection (mysql, mysql-plugin-auth, or drizzle)."))
1487
po::options_description long_options(_("Allowed Options"));
1488
long_options.add(commandline_options).add(drizzle_options).add(client_options);
1490
std::string system_config_dir_drizzle(SYSCONFDIR);
1491
system_config_dir_drizzle.append("/drizzle/drizzle.cnf");
1493
std::string system_config_dir_client(SYSCONFDIR);
1494
system_config_dir_client.append("/drizzle/client.cnf");
1496
std::string user_config_dir((getenv("XDG_CONFIG_HOME")? getenv("XDG_CONFIG_HOME"):"~/.config"));
1498
if (user_config_dir.compare(0, 2, "~/") == 0)
1501
homedir= getenv("HOME");
1502
if (homedir != NULL)
1503
user_config_dir.replace(0, 1, homedir);
1506
po::variables_map vm;
1508
po::positional_options_description p;
1509
p.add("database", 1);
1511
// Disable allow_guessing
1512
int style = po::command_line_style::default_style & ~po::command_line_style::allow_guessing;
1514
po::store(po::command_line_parser(argc, argv).options(long_options).
1515
style(style).positional(p).extra_parser(parse_password_arg).run(),
1518
if (! vm["no-defaults"].as<bool>())
1520
std::string user_config_dir_drizzle(user_config_dir);
1521
user_config_dir_drizzle.append("/drizzle/drizzle.cnf");
1523
std::string user_config_dir_client(user_config_dir);
1524
user_config_dir_client.append("/drizzle/client.cnf");
1526
ifstream user_drizzle_ifs(user_config_dir_drizzle.c_str());
1527
po::store(dpo::parse_config_file(user_drizzle_ifs, drizzle_options), vm);
1529
ifstream user_client_ifs(user_config_dir_client.c_str());
1530
po::store(dpo::parse_config_file(user_client_ifs, client_options), vm);
1532
ifstream system_drizzle_ifs(system_config_dir_drizzle.c_str());
1533
store(dpo::parse_config_file(system_drizzle_ifs, drizzle_options), vm);
1535
ifstream system_client_ifs(system_config_dir_client.c_str());
1536
po::store(dpo::parse_config_file(system_client_ifs, client_options), vm);
1541
default_prompt= strdup(getenv("DRIZZLE_PS1") ?
1542
getenv("DRIZZLE_PS1") :
1544
if (default_prompt == NULL)
1546
fprintf(stderr, _("Memory allocation error while constructing initial "
1547
"prompt. Aborting.\n"));
1551
if (current_prompt.empty())
1552
current_prompt= strdup(default_prompt);
1554
if (current_prompt.empty())
1556
fprintf(stderr, _("Memory allocation error while constructing initial "
1557
"prompt. Aborting.\n"));
1034
1560
processed_prompt= new string();
1035
1561
processed_prompt->reserve(32);
1037
1563
prompt_counter=0;
1039
outfile[0]=0; // no (default) outfile
1040
my_stpcpy(pager, "stdout"); // the default, if --pager wasn't given
1565
outfile.clear(); // no (default) outfile
1566
pager= "stdout"; // the default, if --pager wasn't given
1567
if (const char* tmp= getenv("PAGER"))
1042
char *tmp=getenv("PAGER");
1043
if (tmp && strlen(tmp))
1045
1571
default_pager_set= 1;
1046
my_stpcpy(default_pager, tmp);
1049
if (!isatty(0) || !isatty(1))
1575
if (not isatty(0) || not isatty(1))
1051
status.batch=1; opt_silent=1;
1055
status.add_to_history=1;
1056
status.exit_status=1;
1581
status.setAddToHistory(1);
1582
status.setExitStatus(1);