Merge lp:~eday/drizzle/eday-dev into lp:~drizzle-trunk/drizzle/development
- eday-dev
- Merge into development
Proposed by
Eric Day
Status: | Superseded | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~eday/drizzle/eday-dev | ||||||||||||||||
Merge into: | lp:~drizzle-trunk/drizzle/development | ||||||||||||||||
Diff against target: |
443 lines (+112/-32) 9 files modified
client/drizzle.cc (+7/-8) client/drizzledump.cc (+6/-0) client/drizzleimport.cc (+5/-6) client/drizzleslap.cc (+6/-6) client/drizzletest.cc (+8/-0) plugin/mysql_protocol/oldlibdrizzle.cc (+1/-1) tests/r/mysql_protocol.result (+31/-0) tests/t/mysql_protocol.test (+13/-0) tests/test-run.pl (+35/-11) |
||||||||||||||||
To merge this branch: | bzr merge lp:~eday/drizzle/eday-dev | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Aker | Needs Fixing | ||
Jay Pipes (community) | Approve | ||
Review via email: mp+17181@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Eric Day (eday) wrote : | # |
Revision history for this message
Brian Aker (brianaker) wrote : | # |
Test cases needed, even if just to verify flag/behavior.
review:
Needs Fixing
lp:~eday/drizzle/eday-dev
updated
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/drizzle.cc' | |||
2 | --- client/drizzle.cc 2009-12-25 09:18:10 +0000 | |||
3 | +++ client/drizzle.cc 2010-01-13 08:03:15 +0000 | |||
4 | @@ -186,13 +186,13 @@ | |||
5 | 186 | default_charset_used= false, opt_secure_auth= false, | 186 | default_charset_used= false, opt_secure_auth= false, |
6 | 187 | default_pager_set= false, opt_sigint_ignore= false, | 187 | default_pager_set= false, opt_sigint_ignore= false, |
7 | 188 | auto_vertical_output= false, | 188 | auto_vertical_output= false, |
9 | 189 | show_warnings= false, executing_query= false, interrupted_query= false; | 189 | show_warnings= false, executing_query= false, interrupted_query= false, |
10 | 190 | opt_mysql= false; | ||
11 | 190 | static uint32_t show_progress_size= 0; | 191 | static uint32_t show_progress_size= 0; |
12 | 191 | static bool column_types_flag; | 192 | static bool column_types_flag; |
13 | 192 | static bool preserve_comments= false; | 193 | static bool preserve_comments= false; |
14 | 193 | static uint32_t opt_max_input_line, opt_drizzle_port= 0; | 194 | static uint32_t opt_max_input_line, opt_drizzle_port= 0; |
15 | 194 | static int verbose= 0, opt_silent= 0, opt_local_infile= 0; | 195 | static int verbose= 0, opt_silent= 0, opt_local_infile= 0; |
16 | 195 | static char * opt_drizzle_unix_port= NULL; | ||
17 | 196 | static drizzle_capabilities_t connect_flag= DRIZZLE_CAPABILITIES_NONE; | 196 | static drizzle_capabilities_t connect_flag= DRIZZLE_CAPABILITIES_NONE; |
18 | 197 | static char *current_host, *current_db, *current_user= NULL, | 197 | static char *current_host, *current_db, *current_user= NULL, |
19 | 198 | *opt_password= NULL, *delimiter_str= NULL, *current_prompt= NULL; | 198 | *opt_password= NULL, *delimiter_str= NULL, *current_prompt= NULL; |
20 | @@ -1349,7 +1349,6 @@ | |||
21 | 1349 | if (processed_prompt) | 1349 | if (processed_prompt) |
22 | 1350 | delete processed_prompt; | 1350 | delete processed_prompt; |
23 | 1351 | free(opt_password); | 1351 | free(opt_password); |
24 | 1352 | free(opt_drizzle_unix_port); | ||
25 | 1353 | free(histfile); | 1352 | free(histfile); |
26 | 1354 | free(histfile_tmp); | 1353 | free(histfile_tmp); |
27 | 1355 | free(current_db); | 1354 | free(current_db); |
28 | @@ -1385,7 +1384,7 @@ | |||
29 | 1385 | 1384 | ||
30 | 1386 | if (drizzle_con_add_tcp(&drizzle, &kill_drizzle, current_host, | 1385 | if (drizzle_con_add_tcp(&drizzle, &kill_drizzle, current_host, |
31 | 1387 | opt_drizzle_port, current_user, opt_password, NULL, | 1386 | opt_drizzle_port, current_user, opt_password, NULL, |
33 | 1388 | DRIZZLE_CON_NONE) == NULL) | 1387 | opt_mysql ? DRIZZLE_CON_MYSQL : DRIZZLE_CON_NONE) == NULL) |
34 | 1389 | { | 1388 | { |
35 | 1390 | goto err; | 1389 | goto err; |
36 | 1391 | } | 1390 | } |
37 | @@ -1526,9 +1525,6 @@ | |||
38 | 1526 | (char**) &opt_shutdown, (char**) &opt_shutdown, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 1525 | (char**) &opt_shutdown, (char**) &opt_shutdown, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
39 | 1527 | {"silent", 's', N_("Be more silent. Print results with a tab as separator, each row on new line."), 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, | 1526 | {"silent", 's', N_("Be more silent. Print results with a tab as separator, each row on new line."), 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, |
40 | 1528 | 0, 0}, | 1527 | 0, 0}, |
41 | 1529 | {"socket", 'S', N_("Socket file to use for connection."), | ||
42 | 1530 | (char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR_ALLOC, | ||
43 | 1531 | REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | ||
44 | 1532 | {"table", 't', N_("Output in table format."), (char**) &output_tables, | 1528 | {"table", 't', N_("Output in table format."), (char**) &output_tables, |
45 | 1533 | (char**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 1529 | (char**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
46 | 1534 | {"tee", OPT_TEE, | 1530 | {"tee", OPT_TEE, |
47 | @@ -1580,6 +1576,9 @@ | |||
48 | 1580 | 0, 0, 0, 0, 0, 0}, | 1576 | 0, 0, 0, 0, 0, 0}, |
49 | 1581 | {"ping", OPT_PING, N_("Ping the server to check if it's alive."), | 1577 | {"ping", OPT_PING, N_("Ping the server to check if it's alive."), |
50 | 1582 | (char**) &opt_ping, (char**) &opt_ping, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 1578 | (char**) &opt_ping, (char**) &opt_ping, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
51 | 1579 | {"mysql", 'm', N_("Use MySQL Protocol."), | ||
52 | 1580 | (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0, | ||
53 | 1581 | 0, 0, 0}, | ||
54 | 1583 | { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} | 1582 | { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} |
55 | 1584 | }; | 1583 | }; |
56 | 1585 | 1584 | ||
57 | @@ -3881,7 +3880,7 @@ | |||
58 | 3881 | } | 3880 | } |
59 | 3882 | drizzle_create(&drizzle); | 3881 | drizzle_create(&drizzle); |
60 | 3883 | if (drizzle_con_add_tcp(&drizzle, &con, host, opt_drizzle_port, user, | 3882 | if (drizzle_con_add_tcp(&drizzle, &con, host, opt_drizzle_port, user, |
62 | 3884 | password, database, DRIZZLE_CON_NONE) == NULL) | 3883 | password, database, opt_mysql ? DRIZZLE_CON_MYSQL : DRIZZLE_CON_NONE) == NULL) |
63 | 3885 | { | 3884 | { |
64 | 3886 | (void) put_error(&con, NULL); | 3885 | (void) put_error(&con, NULL); |
65 | 3887 | (void) fflush(stdout); | 3886 | (void) fflush(stdout); |
66 | 3888 | 3887 | ||
67 | === modified file 'client/drizzledump.cc' | |||
68 | --- client/drizzledump.cc 2009-12-25 08:50:15 +0000 | |||
69 | +++ client/drizzledump.cc 2010-01-13 08:03:15 +0000 | |||
70 | @@ -81,6 +81,7 @@ | |||
71 | 81 | static bool verbose= false; | 81 | static bool verbose= false; |
72 | 82 | static bool opt_no_create_info= false; | 82 | static bool opt_no_create_info= false; |
73 | 83 | static bool opt_no_data= false; | 83 | static bool opt_no_data= false; |
74 | 84 | static bool opt_mysql= false; | ||
75 | 84 | static bool quick= true; | 85 | static bool quick= true; |
76 | 85 | static bool extended_insert= true; | 86 | static bool extended_insert= true; |
77 | 86 | static bool ignore_errors= false; | 87 | static bool ignore_errors= false; |
78 | @@ -257,6 +258,9 @@ | |||
79 | 257 | "dump. Automatically turns --single-transaction and --lock-tables off.", | 258 | "dump. Automatically turns --single-transaction and --lock-tables off.", |
80 | 258 | (char**) &opt_lock_all_tables, (char**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, | 259 | (char**) &opt_lock_all_tables, (char**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, |
81 | 259 | 0, 0, 0, 0, 0, 0}, | 260 | 0, 0, 0, 0, 0, 0}, |
82 | 261 | {"mysql", 'm', N_("Use MySQL Protocol."), | ||
83 | 262 | (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0, | ||
84 | 263 | 0, 0, 0}, | ||
85 | 260 | {"no-autocommit", OPT_AUTOCOMMIT, | 264 | {"no-autocommit", OPT_AUTOCOMMIT, |
86 | 261 | "Wrap tables with autocommit/commit statements.", | 265 | "Wrap tables with autocommit/commit statements.", |
87 | 262 | (char**) &opt_autocommit, (char**) &opt_autocommit, 0, GET_BOOL, NO_ARG, | 266 | (char**) &opt_autocommit, (char**) &opt_autocommit, 0, GET_BOOL, NO_ARG, |
88 | @@ -913,6 +917,8 @@ | |||
89 | 913 | drizzle_con_create(&drizzle, &dcon); | 917 | drizzle_con_create(&drizzle, &dcon); |
90 | 914 | drizzle_con_set_tcp(&dcon, host, opt_drizzle_port); | 918 | drizzle_con_set_tcp(&dcon, host, opt_drizzle_port); |
91 | 915 | drizzle_con_set_auth(&dcon, user, passwd); | 919 | drizzle_con_set_auth(&dcon, user, passwd); |
92 | 920 | if (opt_mysql) | ||
93 | 921 | drizzle_con_add_options(&dcon, DRIZZLE_CON_MYSQL); | ||
94 | 916 | ret= drizzle_con_connect(&dcon); | 922 | ret= drizzle_con_connect(&dcon); |
95 | 917 | if (ret != DRIZZLE_RETURN_OK) | 923 | if (ret != DRIZZLE_RETURN_OK) |
96 | 918 | { | 924 | { |
97 | 919 | 925 | ||
98 | === modified file 'client/drizzleimport.cc' | |||
99 | --- client/drizzleimport.cc 2009-12-11 21:54:18 +0000 | |||
100 | +++ client/drizzleimport.cc 2010-01-13 08:03:15 +0000 | |||
101 | @@ -60,7 +60,7 @@ | |||
102 | 60 | static bool verbose= false, lock_tables= false, ignore_errors= false, | 60 | static bool verbose= false, lock_tables= false, ignore_errors= false, |
103 | 61 | opt_delete= false, opt_replace= false, silent= false, | 61 | opt_delete= false, opt_replace= false, silent= false, |
104 | 62 | ignore_unique= false, opt_low_priority= false, | 62 | ignore_unique= false, opt_low_priority= false, |
106 | 63 | tty_password= false; | 63 | tty_password= false, opt_mysql= false; |
107 | 64 | 64 | ||
108 | 65 | static uint32_t opt_use_threads= 0, opt_local_file= 0; | 65 | static uint32_t opt_use_threads= 0, opt_local_file= 0; |
109 | 66 | static char *opt_password= NULL, *current_user= NULL, | 66 | static char *opt_password= NULL, *current_user= NULL, |
110 | @@ -68,7 +68,6 @@ | |||
111 | 68 | *lines_terminated= NULL, *enclosed= NULL, *opt_enclosed= NULL, | 68 | *lines_terminated= NULL, *enclosed= NULL, *opt_enclosed= NULL, |
112 | 69 | *escaped= NULL, *opt_columns= NULL; | 69 | *escaped= NULL, *opt_columns= NULL; |
113 | 70 | static uint32_t opt_drizzle_port= 0; | 70 | static uint32_t opt_drizzle_port= 0; |
114 | 71 | static char * opt_drizzle_unix_port= 0; | ||
115 | 72 | static int64_t opt_ignore_lines= -1; | 71 | static int64_t opt_ignore_lines= -1; |
116 | 73 | 72 | ||
117 | 74 | static struct my_option my_long_options[] = | 73 | static struct my_option my_long_options[] = |
118 | @@ -116,6 +115,9 @@ | |||
119 | 116 | {"low-priority", OPT_LOW_PRIORITY, | 115 | {"low-priority", OPT_LOW_PRIORITY, |
120 | 117 | "Use LOW_PRIORITY when updating the table.", (char**) &opt_low_priority, | 116 | "Use LOW_PRIORITY when updating the table.", (char**) &opt_low_priority, |
121 | 118 | (char**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 117 | (char**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
122 | 118 | {"mysql", 'm', N_("Use MySQL Protocol."), | ||
123 | 119 | (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0, | ||
124 | 120 | 0, 0, 0}, | ||
125 | 119 | {"password", 'P', | 121 | {"password", 'P', |
126 | 120 | "Password to use when connecting to server. If password is not given it's asked from the tty.", | 122 | "Password to use when connecting to server. If password is not given it's asked from the tty.", |
127 | 121 | 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, | 123 | 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
128 | @@ -129,9 +131,6 @@ | |||
129 | 129 | (char**) &opt_replace, (char**) &opt_replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 131 | (char**) &opt_replace, (char**) &opt_replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
130 | 130 | {"silent", 's', "Be more silent.", (char**) &silent, (char**) &silent, 0, | 132 | {"silent", 's', "Be more silent.", (char**) &silent, (char**) &silent, 0, |
131 | 131 | GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, | 133 | GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
132 | 132 | {"socket", 'S', "Socket file to use for connection.", | ||
133 | 133 | (char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR, | ||
134 | 134 | REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | ||
135 | 135 | {"use-threads", OPT_USE_THREADS, | 134 | {"use-threads", OPT_USE_THREADS, |
136 | 136 | "Load files in parallel. The argument is the number " | 135 | "Load files in parallel. The argument is the number " |
137 | 137 | "of threads to use for loading data.", | 136 | "of threads to use for loading data.", |
138 | @@ -406,7 +405,7 @@ | |||
139 | 406 | if (!(drizzle= drizzle_create(NULL))) | 405 | if (!(drizzle= drizzle_create(NULL))) |
140 | 407 | return 0; | 406 | return 0; |
141 | 408 | if (!(con= drizzle_con_add_tcp(drizzle,NULL,host,opt_drizzle_port,user,passwd, | 407 | if (!(con= drizzle_con_add_tcp(drizzle,NULL,host,opt_drizzle_port,user,passwd, |
143 | 409 | database, DRIZZLE_CON_NONE))) | 408 | database, opt_mysql ? DRIZZLE_CON_MYSQL : DRIZZLE_CON_NONE))) |
144 | 410 | { | 409 | { |
145 | 411 | return 0; | 410 | return 0; |
146 | 412 | } | 411 | } |
147 | 413 | 412 | ||
148 | === modified file 'client/drizzleslap.cc' | |||
149 | --- client/drizzleslap.cc 2009-12-23 08:42:15 +0000 | |||
150 | +++ client/drizzleslap.cc 2010-01-13 08:03:15 +0000 | |||
151 | @@ -130,13 +130,13 @@ | |||
152 | 130 | *user_supplied_post_statements= NULL, | 130 | *user_supplied_post_statements= NULL, |
153 | 131 | *default_engine= NULL, | 131 | *default_engine= NULL, |
154 | 132 | *pre_system= NULL, | 132 | *pre_system= NULL, |
157 | 133 | *post_system= NULL, | 133 | *post_system= NULL; |
156 | 134 | *opt_drizzle_unix_port= NULL; | ||
158 | 135 | 134 | ||
159 | 136 | const char *delimiter= "\n"; | 135 | const char *delimiter= "\n"; |
160 | 137 | 136 | ||
161 | 138 | const char *create_schema_string= "drizzleslap"; | 137 | const char *create_schema_string= "drizzleslap"; |
162 | 139 | 138 | ||
163 | 139 | static bool opt_mysql= false; | ||
164 | 140 | static bool opt_preserve= true; | 140 | static bool opt_preserve= true; |
165 | 141 | static bool opt_only_print= false; | 141 | static bool opt_only_print= false; |
166 | 142 | static bool opt_burnin= false; | 142 | static bool opt_burnin= false; |
167 | @@ -630,6 +630,9 @@ | |||
168 | 630 | {"label", OPT_SLAP_LABEL, "Label to use for print and csv output.", | 630 | {"label", OPT_SLAP_LABEL, "Label to use for print and csv output.", |
169 | 631 | (char**) &opt_label, (char**) &opt_label, 0, | 631 | (char**) &opt_label, (char**) &opt_label, 0, |
170 | 632 | GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | 632 | GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
171 | 633 | {"mysql", 'm', N_("Use MySQL Protocol."), | ||
172 | 634 | (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0, | ||
173 | 635 | 0, 0, 0}, | ||
174 | 633 | {"number-blob-cols", OPT_SLAP_BLOB_COL, | 636 | {"number-blob-cols", OPT_SLAP_BLOB_COL, |
175 | 634 | "Number of BLOB columns to create table with if specifying --auto-generate-sql. Example --number-blob-cols=3:1024/2048 would give you 3 blobs with a random size between 1024 and 2048. ", | 637 | "Number of BLOB columns to create table with if specifying --auto-generate-sql. Example --number-blob-cols=3:1024/2048 would give you 3 blobs with a random size between 1024 and 2048. ", |
176 | 635 | (char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG, | 638 | (char**) &num_blob_cols_opt, (char**) &num_blob_cols_opt, 0, GET_STR, REQUIRED_ARG, |
177 | @@ -690,9 +693,6 @@ | |||
178 | 690 | {"silent", 's', "Run program in silent mode - no output.", | 693 | {"silent", 's', "Run program in silent mode - no output.", |
179 | 691 | (char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG, | 694 | (char**) &opt_silent, (char**) &opt_silent, 0, GET_BOOL, NO_ARG, |
180 | 692 | 0, 0, 0, 0, 0, 0}, | 695 | 0, 0, 0, 0, 0, 0}, |
181 | 693 | {"socket", 'S', "Socket file to use for connection.", | ||
182 | 694 | (char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR, | ||
183 | 695 | REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, | ||
184 | 696 | {"timer-length", OPT_SLAP_TIMER_LENGTH, | 696 | {"timer-length", OPT_SLAP_TIMER_LENGTH, |
185 | 697 | "Require drizzleslap to run each specific test a certain amount of time in seconds.", | 697 | "Require drizzleslap to run each specific test a certain amount of time in seconds.", |
186 | 698 | (char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT, | 698 | (char**) &opt_timer_length, (char**) &opt_timer_length, 0, GET_UINT, |
187 | @@ -2698,7 +2698,7 @@ | |||
188 | 2698 | drizzle_con_add_tcp(drizzle, con, host, opt_drizzle_port, user, | 2698 | drizzle_con_add_tcp(drizzle, con, host, opt_drizzle_port, user, |
189 | 2699 | opt_password, | 2699 | opt_password, |
190 | 2700 | connect_to_schema ? create_schema_string : NULL, | 2700 | connect_to_schema ? create_schema_string : NULL, |
192 | 2701 | DRIZZLE_CON_NONE) == NULL) | 2701 | opt_mysql ? DRIZZLE_CON_MYSQL : DRIZZLE_CON_NONE) == NULL) |
193 | 2702 | { | 2702 | { |
194 | 2703 | fprintf(stderr,"%s: Error creating drizzle object\n", my_progname); | 2703 | fprintf(stderr,"%s: Error creating drizzle object\n", my_progname); |
195 | 2704 | exit(1); | 2704 | exit(1); |
196 | 2705 | 2705 | ||
197 | === modified file 'client/drizzletest.cc' | |||
198 | --- client/drizzletest.cc 2009-12-23 08:01:21 +0000 | |||
199 | +++ client/drizzletest.cc 2010-01-13 08:03:15 +0000 | |||
200 | @@ -115,6 +115,7 @@ | |||
201 | 115 | static bool abort_on_error= true; | 115 | static bool abort_on_error= true; |
202 | 116 | static bool server_initialized= false; | 116 | static bool server_initialized= false; |
203 | 117 | static bool is_windows= false; | 117 | static bool is_windows= false; |
204 | 118 | static bool opt_mysql= false; | ||
205 | 118 | static char **default_argv; | 119 | static char **default_argv; |
206 | 119 | static const char *load_default_groups[]= { "drizzletest", "client", 0 }; | 120 | static const char *load_default_groups[]= { "drizzletest", "client", 0 }; |
207 | 120 | static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer; | 121 | static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer; |
208 | @@ -3930,6 +3931,8 @@ | |||
209 | 3930 | die("Failed on drizzle_create()"); | 3931 | die("Failed on drizzle_create()"); |
210 | 3931 | if (!drizzle_con_create(con_slot->drizzle, &con_slot->con)) | 3932 | if (!drizzle_con_create(con_slot->drizzle, &con_slot->con)) |
211 | 3932 | die("Failed on drizzle_con_create()"); | 3933 | die("Failed on drizzle_con_create()"); |
212 | 3934 | if (opt_mysql) | ||
213 | 3935 | drizzle_con_add_options(&con_slot->con, DRIZZLE_CON_MYSQL); | ||
214 | 3933 | 3936 | ||
215 | 3934 | /* Use default db name */ | 3937 | /* Use default db name */ |
216 | 3935 | if (ds_database.length() == 0) | 3938 | if (ds_database.length() == 0) |
217 | @@ -4603,6 +4606,9 @@ | |||
218 | 4603 | "Max number of connection attempts when connecting to server", | 4606 | "Max number of connection attempts when connecting to server", |
219 | 4604 | (char**) &opt_max_connect_retries, (char**) &opt_max_connect_retries, 0, | 4607 | (char**) &opt_max_connect_retries, (char**) &opt_max_connect_retries, 0, |
220 | 4605 | GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, | 4608 | GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, |
221 | 4609 | {"mysql", 'm', N_("Use MySQL Protocol."), | ||
222 | 4610 | (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0, | ||
223 | 4611 | 0, 0, 0}, | ||
224 | 4606 | {"password", 'P', "Password to use when connecting to server.", | 4612 | {"password", 'P', "Password to use when connecting to server.", |
225 | 4607 | 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, | 4613 | 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
226 | 4608 | {"port", 'p', "Port number to use for connection or 0 for default to, in " | 4614 | {"port", 'p', "Port number to use for connection or 0 for default to, in " |
227 | @@ -5612,6 +5618,8 @@ | |||
228 | 5612 | die("Failed in drizzle_create()"); | 5618 | die("Failed in drizzle_create()"); |
229 | 5613 | if (!( drizzle_con_create(cur_con->drizzle, &cur_con->con))) | 5619 | if (!( drizzle_con_create(cur_con->drizzle, &cur_con->con))) |
230 | 5614 | die("Failed in drizzle_con_create()"); | 5620 | die("Failed in drizzle_con_create()"); |
231 | 5621 | if (opt_mysql) | ||
232 | 5622 | drizzle_con_add_options(&cur_con->con, DRIZZLE_CON_MYSQL); | ||
233 | 5615 | 5623 | ||
234 | 5616 | if (!(cur_con->name = strdup("default"))) | 5624 | if (!(cur_con->name = strdup("default"))) |
235 | 5617 | die("Out of memory"); | 5625 | die("Out of memory"); |
236 | 5618 | 5626 | ||
237 | === modified file 'plugin/mysql_protocol/oldlibdrizzle.cc' | |||
238 | --- plugin/mysql_protocol/oldlibdrizzle.cc 2009-12-23 21:16:15 +0000 | |||
239 | +++ plugin/mysql_protocol/oldlibdrizzle.cc 2010-01-13 08:03:15 +0000 | |||
240 | @@ -222,7 +222,7 @@ | |||
241 | 222 | break; | 222 | break; |
242 | 223 | 223 | ||
243 | 224 | case 14: /* PING */ | 224 | case 14: /* PING */ |
245 | 225 | (*l_packet)[0]= (unsigned char) COM_SHUTDOWN; | 225 | (*l_packet)[0]= (unsigned char) COM_PING; |
246 | 226 | break; | 226 | break; |
247 | 227 | 227 | ||
248 | 228 | 228 | ||
249 | 229 | 229 | ||
250 | === added file 'tests/r/mysql_protocol.result' | |||
251 | --- tests/r/mysql_protocol.result 1970-01-01 00:00:00 +0000 | |||
252 | +++ tests/r/mysql_protocol.result 2010-01-13 08:03:15 +0000 | |||
253 | @@ -0,0 +1,31 @@ | |||
254 | 1 | DROP TABLE IF EXISTS t1; | ||
255 | 2 | CREATE TABLE t1(a int, key (a)); | ||
256 | 3 | INSERT INTO t1 VALUES (1), (2); | ||
257 | 4 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | ||
258 | 5 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | ||
259 | 6 | DROP TABLE IF EXISTS `t1`; | ||
260 | 7 | CREATE TABLE `t1` ( | ||
261 | 8 | `a` int DEFAULT NULL, | ||
262 | 9 | KEY `a` (`a`) | ||
263 | 10 | ) ENGINE=InnoDB; | ||
264 | 11 | |||
265 | 12 | ALTER TABLE `t1` DISABLE KEYS; | ||
266 | 13 | INSERT INTO `t1` VALUES (1),(2); | ||
267 | 14 | ALTER TABLE `t1` ENABLE KEYS; | ||
268 | 15 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; | ||
269 | 16 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; | ||
270 | 17 | DROP TABLE t1; | ||
271 | 18 | drizzled is alive | ||
272 | 19 | Benchmark | ||
273 | 20 | Load: mixed | ||
274 | 21 | Average Time took to generate schema and initial data: 0.000 seconds | ||
275 | 22 | Average number of seconds to run all queries: 0.000 seconds | ||
276 | 23 | Minimum number of seconds to run all queries: 0.000 seconds | ||
277 | 24 | Maximum number of seconds to run all queries: 0.000 seconds | ||
278 | 25 | Total time for tests: 0.000 seconds | ||
279 | 26 | Standard Deviation: 0.000 | ||
280 | 27 | Number of queries in create queries: 0 | ||
281 | 28 | Number of clients running queries: 1/0 | ||
282 | 29 | Number of times test was run: 1 | ||
283 | 30 | Average number of queries per client: 0 | ||
284 | 31 | |||
285 | 0 | 32 | ||
286 | === added file 'tests/t/mysql_protocol.test' | |||
287 | --- tests/t/mysql_protocol.test 1970-01-01 00:00:00 +0000 | |||
288 | +++ tests/t/mysql_protocol.test 2010-01-13 08:03:15 +0000 | |||
289 | @@ -0,0 +1,13 @@ | |||
290 | 1 | |||
291 | 2 | --disable_warnings | ||
292 | 3 | DROP TABLE IF EXISTS t1; | ||
293 | 4 | --enable_warnings | ||
294 | 5 | |||
295 | 6 | CREATE TABLE t1(a int, key (a)); | ||
296 | 7 | INSERT INTO t1 VALUES (1), (2); | ||
297 | 8 | --exec $DRIZZLE_DUMP_MYSQL --skip-create --skip-comments test t1 | ||
298 | 9 | DROP TABLE t1; | ||
299 | 10 | |||
300 | 11 | --exec $DRIZZLE_MYSQL --ping | ||
301 | 12 | |||
302 | 13 | --exec $DRIZZLE_SLAP_MYSQL | ||
303 | 0 | 14 | ||
304 | === modified file 'tests/test-run.pl' | |||
305 | --- tests/test-run.pl 2009-12-21 05:34:07 +0000 | |||
306 | +++ tests/test-run.pl 2010-01-13 08:03:15 +0000 | |||
307 | @@ -271,6 +271,7 @@ | |||
308 | 271 | 271 | ||
309 | 272 | our $opt_max_save_core= 5; | 272 | our $opt_max_save_core= 5; |
310 | 273 | my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far. | 273 | my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far. |
311 | 274 | our $mysql_port_offset= 50; | ||
312 | 274 | 275 | ||
313 | 275 | ###################################################################### | 276 | ###################################################################### |
314 | 276 | # | 277 | # |
315 | @@ -930,6 +931,7 @@ | |||
316 | 930 | path_pid => "$opt_vardir/run/master.pid", | 931 | path_pid => "$opt_vardir/run/master.pid", |
317 | 931 | path_sock => "$sockdir/master.sock", | 932 | path_sock => "$sockdir/master.sock", |
318 | 932 | port => $opt_master_myport, | 933 | port => $opt_master_myport, |
319 | 934 | mysql_port => $opt_master_myport + $mysql_port_offset, | ||
320 | 933 | start_timeout => 400, # enough time create innodb tables | 935 | start_timeout => 400, # enough time create innodb tables |
321 | 934 | cluster => 0, # index in clusters list | 936 | cluster => 0, # index in clusters list |
322 | 935 | start_opts => [], | 937 | start_opts => [], |
323 | @@ -945,6 +947,7 @@ | |||
324 | 945 | path_pid => "$opt_vardir/run/master1.pid", | 947 | path_pid => "$opt_vardir/run/master1.pid", |
325 | 946 | path_sock => "$sockdir/master1.sock", | 948 | path_sock => "$sockdir/master1.sock", |
326 | 947 | port => $opt_master_myport + 1, | 949 | port => $opt_master_myport + 1, |
327 | 950 | mysql_port => $opt_master_myport + 1 + $mysql_port_offset, | ||
328 | 948 | start_timeout => 400, # enough time create innodb tables | 951 | start_timeout => 400, # enough time create innodb tables |
329 | 949 | cluster => 0, # index in clusters list | 952 | cluster => 0, # index in clusters list |
330 | 950 | start_opts => [], | 953 | start_opts => [], |
331 | @@ -957,9 +960,10 @@ | |||
332 | 957 | idx => 0, | 960 | idx => 0, |
333 | 958 | path_myddir => "$opt_vardir/slave-data", | 961 | path_myddir => "$opt_vardir/slave-data", |
334 | 959 | path_myerr => "$opt_vardir/log/slave.err", | 962 | path_myerr => "$opt_vardir/log/slave.err", |
338 | 960 | path_pid => "$opt_vardir/run/slave.pid", | 963 | path_pid => "$opt_vardir/run/slave.pid", |
339 | 961 | path_sock => "$sockdir/slave.sock", | 964 | path_sock => "$sockdir/slave.sock", |
340 | 962 | port => $opt_slave_myport, | 965 | port => $opt_slave_myport, |
341 | 966 | mysql_port => $opt_slave_myport + $mysql_port_offset, | ||
342 | 963 | start_timeout => 400, | 967 | start_timeout => 400, |
343 | 964 | 968 | ||
344 | 965 | cluster => 1, # index in clusters list | 969 | cluster => 1, # index in clusters list |
345 | @@ -973,9 +977,10 @@ | |||
346 | 973 | idx => 1, | 977 | idx => 1, |
347 | 974 | path_myddir => "$opt_vardir/slave1-data", | 978 | path_myddir => "$opt_vardir/slave1-data", |
348 | 975 | path_myerr => "$opt_vardir/log/slave1.err", | 979 | path_myerr => "$opt_vardir/log/slave1.err", |
352 | 976 | path_pid => "$opt_vardir/run/slave1.pid", | 980 | path_pid => "$opt_vardir/run/slave1.pid", |
353 | 977 | path_sock => "$sockdir/slave1.sock", | 981 | path_sock => "$sockdir/slave1.sock", |
354 | 978 | port => $opt_slave_myport + 1, | 982 | port => $opt_slave_myport + 1, |
355 | 983 | mysql_port => $opt_slave_myport + 1 + $mysql_port_offset, | ||
356 | 979 | start_timeout => 300, | 984 | start_timeout => 300, |
357 | 980 | cluster => -1, # index in clusters list | 985 | cluster => -1, # index in clusters list |
358 | 981 | start_opts => [], | 986 | start_opts => [], |
359 | @@ -988,9 +993,10 @@ | |||
360 | 988 | idx => 2, | 993 | idx => 2, |
361 | 989 | path_myddir => "$opt_vardir/slave2-data", | 994 | path_myddir => "$opt_vardir/slave2-data", |
362 | 990 | path_myerr => "$opt_vardir/log/slave2.err", | 995 | path_myerr => "$opt_vardir/log/slave2.err", |
366 | 991 | path_pid => "$opt_vardir/run/slave2.pid", | 996 | path_pid => "$opt_vardir/run/slave2.pid", |
367 | 992 | path_sock => "$sockdir/slave2.sock", | 997 | path_sock => "$sockdir/slave2.sock", |
368 | 993 | port => $opt_slave_myport + 2, | 998 | port => $opt_slave_myport + 2, |
369 | 999 | mysql_port => $opt_slave_myport + 2 + $mysql_port_offset, | ||
370 | 994 | start_timeout => 300, | 1000 | start_timeout => 300, |
371 | 995 | cluster => -1, # index in clusters list | 1001 | cluster => -1, # index in clusters list |
372 | 996 | start_opts => [], | 1002 | start_opts => [], |
373 | @@ -1434,6 +1440,9 @@ | |||
374 | 1434 | # ---------------------------------------------------- | 1440 | # ---------------------------------------------------- |
375 | 1435 | my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]); | 1441 | my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]); |
376 | 1436 | my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]); | 1442 | my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]); |
377 | 1443 | my $cmdline_mysqldumpmysql= mtr_native_path($exe_drizzledump) . | ||
378 | 1444 | " --no-defaults -uroot " . | ||
379 | 1445 | "--mysql --port=$master->[0]->{'mysql_port'} "; | ||
380 | 1437 | 1446 | ||
381 | 1438 | if ( $opt_debug ) | 1447 | if ( $opt_debug ) |
382 | 1439 | { | 1448 | { |
383 | @@ -1441,9 +1450,12 @@ | |||
384 | 1441 | " --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace"; | 1450 | " --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace"; |
385 | 1442 | $cmdline_mysqldumpslave .= | 1451 | $cmdline_mysqldumpslave .= |
386 | 1443 | " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace"; | 1452 | " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace"; |
387 | 1453 | $cmdline_mysqldumpmysql .= | ||
388 | 1454 | " --debug=d:t:A,$path_vardir_trace/log/mysqldump-mysql.trace"; | ||
389 | 1444 | } | 1455 | } |
390 | 1445 | $ENV{'DRIZZLE_DUMP'}= $cmdline_mysqldump; | 1456 | $ENV{'DRIZZLE_DUMP'}= $cmdline_mysqldump; |
391 | 1446 | $ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_mysqldumpslave; | 1457 | $ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_mysqldumpslave; |
392 | 1458 | $ENV{'DRIZZLE_DUMP_MYSQL'}= $cmdline_mysqldumpmysql; | ||
393 | 1447 | 1459 | ||
394 | 1448 | # ---------------------------------------------------- | 1460 | # ---------------------------------------------------- |
395 | 1449 | # Setup env so childs can execute mysqlslap | 1461 | # Setup env so childs can execute mysqlslap |
396 | @@ -1454,13 +1466,20 @@ | |||
397 | 1454 | mtr_native_path($exe_drizzleslap) . | 1466 | mtr_native_path($exe_drizzleslap) . |
398 | 1455 | " -uroot " . | 1467 | " -uroot " . |
399 | 1456 | "--port=$master->[0]->{'port'} "; | 1468 | "--port=$master->[0]->{'port'} "; |
400 | 1469 | my $cmdline_drizzleslapmysql= | ||
401 | 1470 | mtr_native_path($exe_drizzleslap) . | ||
402 | 1471 | " -uroot " . | ||
403 | 1472 | "--mysql --port=$master->[0]->{'mysql_port'} "; | ||
404 | 1457 | 1473 | ||
405 | 1458 | if ( $opt_debug ) | 1474 | if ( $opt_debug ) |
406 | 1459 | { | 1475 | { |
407 | 1460 | $cmdline_drizzleslap .= | 1476 | $cmdline_drizzleslap .= |
408 | 1461 | " --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace"; | 1477 | " --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace"; |
409 | 1478 | $cmdline_drizzleslapmysql .= | ||
410 | 1479 | " --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace"; | ||
411 | 1462 | } | 1480 | } |
412 | 1463 | $ENV{'DRIZZLE_SLAP'}= $cmdline_drizzleslap; | 1481 | $ENV{'DRIZZLE_SLAP'}= $cmdline_drizzleslap; |
413 | 1482 | $ENV{'DRIZZLE_SLAP_MYSQL'}= $cmdline_drizzleslapmysql; | ||
414 | 1464 | } | 1483 | } |
415 | 1465 | 1484 | ||
416 | 1466 | 1485 | ||
417 | @@ -1488,8 +1507,13 @@ | |||
418 | 1488 | mtr_native_path($exe_drizzle) . | 1507 | mtr_native_path($exe_drizzle) . |
419 | 1489 | " --no-defaults --host=localhost --user=root --password= " . | 1508 | " --no-defaults --host=localhost --user=root --password= " . |
420 | 1490 | "--port=$master->[0]->{'port'} "; | 1509 | "--port=$master->[0]->{'port'} "; |
421 | 1510 | my $cmdline_drizzlemysql= | ||
422 | 1511 | mtr_native_path($exe_drizzle) . | ||
423 | 1512 | " --no-defaults --host=localhost --user=root --password= " . | ||
424 | 1513 | "--mysql --port=$master->[0]->{'mysql_port'} "; | ||
425 | 1491 | 1514 | ||
426 | 1492 | $ENV{'MYSQL'}= $cmdline_mysql; | 1515 | $ENV{'MYSQL'}= $cmdline_mysql; |
427 | 1516 | $ENV{'DRIZZLE_MYSQL'}= $cmdline_drizzlemysql; | ||
428 | 1493 | 1517 | ||
429 | 1494 | # ---------------------------------------------------- | 1518 | # ---------------------------------------------------- |
430 | 1495 | # Setup env so childs can execute bug25714 | 1519 | # Setup env so childs can execute bug25714 |
431 | @@ -2470,10 +2494,10 @@ | |||
432 | 2470 | $mysqld->{'path_pid'}); | 2494 | $mysqld->{'path_pid'}); |
433 | 2471 | 2495 | ||
434 | 2472 | mtr_add_arg($args, "%s--drizzle-protocol-port=%d", $prefix, | 2496 | mtr_add_arg($args, "%s--drizzle-protocol-port=%d", $prefix, |
436 | 2473 | $mysqld->{'port'}); | 2497 | $mysqld->{'port'}); |
437 | 2474 | 2498 | ||
438 | 2475 | mtr_add_arg($args, "%s--mysql-protocol-port=%d", $prefix, | 2499 | mtr_add_arg($args, "%s--mysql-protocol-port=%d", $prefix, |
440 | 2476 | $mysqld->{'port'} + 50); | 2500 | $mysqld->{'mysql_port'}); |
441 | 2477 | 2501 | ||
442 | 2478 | mtr_add_arg($args, "%s--datadir=%s", $prefix, | 2502 | mtr_add_arg($args, "%s--datadir=%s", $prefix, |
443 | 2479 | $mysqld->{'path_myddir'}); | 2503 | $mysqld->{'path_myddir'}); |
This adds the --mysql option to tools, which can be used to run the test suite using the MySQL protocol (just pass --mysql option to all client tools in test_run.pl). I'm not modifying the test suite now since other work is being done there. I'd like to create a make test-mysql or something which would set this flag to be passed through and test on the different port/protocol.