Merge lp:~linuxjedi/libdrizzle/5.1-test-fixes into lp:libdrizzle

Proposed by Andrew Hutchings on 2013-04-26
Status: Merged
Approved by: Andrew Hutchings on 2013-04-26
Approved revision: 118
Merged at revision: 118
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-test-fixes
Merge into: lp:libdrizzle
Diff against target: 682 lines (+161/-152)
13 files modified
.bzrignore (+1/-0)
tests/unit/column.c (+10/-10)
tests/unit/common.c (+13/-7)
tests/unit/common.h (+2/-2)
tests/unit/datetypes.c (+13/-11)
tests/unit/insert_id.c (+14/-14)
tests/unit/nulls.c (+15/-15)
tests/unit/numbers.c (+11/-11)
tests/unit/query.c (+14/-14)
tests/unit/row.c (+16/-16)
tests/unit/statement.c (+18/-18)
tests/unit/statement_char.c (+18/-18)
tests/unit/unbuffered_query.c (+16/-16)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-test-fixes
Reviewer Review Type Date Requested Status
Drizzle Trunk 2013-04-26 Pending
Review via email: mp+161216@code.launchpad.net

Description of the change

Fix test cases

1. Datetypes test needs 5.6.4 onwards (so broke Ubuntu 12.04 builder)
2. Automake 1.13 test running works in parallel so test now support this

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-12-28 10:37:41 +0000
3+++ .bzrignore 2013-04-26 19:01:27 +0000
4@@ -40,3 +40,4 @@
5 docs/changes/
6 docs/latex/
7 libdrizzle-config
8+test-suite.log
9
10=== modified file 'tests/unit/column.c'
11--- tests/unit/column.c 2013-03-19 20:38:59 +0000
12+++ tests/unit/column.c 2013-04-26 19:01:27 +0000
13@@ -56,13 +56,13 @@
14
15 set_up_connection();
16 CHECKED_QUERY("SET CHARACTER SET latin1"); /* Or any other one-byte-per-character character set */
17- set_up_schema();
18-
19- CHECKED_QUERY("create table libdrizzle.t1 (a int primary key auto_increment, b varchar(255), c timestamp default current_timestamp)");
20-
21- CHECKED_QUERY("insert into libdrizzle.t1 (b) values ('this'),('is'),('war')");
22-
23- CHECKED_QUERY("select * from libdrizzle.t1");
24+ set_up_schema("test_column");
25+
26+ CHECKED_QUERY("create table test_column.t1 (a int primary key auto_increment, b varchar(255), c timestamp default current_timestamp)");
27+
28+ CHECKED_QUERY("insert into test_column.t1 (b) values ('this'),('is'),('war')");
29+
30+ CHECKED_QUERY("select * from test_column.t1");
31
32 drizzle_result_buffer(result);
33 num_fields= drizzle_result_column_count(result);
34@@ -82,7 +82,7 @@
35 while ((column= drizzle_column_next(result)))
36 {
37 cur_column++;
38- ASSERT_EQ_(strcmp(drizzle_column_db(column), "libdrizzle"), 0, "Column has bad DB name");
39+ ASSERT_EQ_(strcmp(drizzle_column_db(column), "test_column"), 0, "Column has bad DB name");
40 ASSERT_EQ_(strcmp(drizzle_column_table(column), "t1"), 0, "Column had bad table name");
41 switch (cur_column) {
42 case 1:
43@@ -105,9 +105,9 @@
44
45 drizzle_result_free(result);
46
47- CHECKED_QUERY("DROP TABLE libdrizzle.t1");
48+ CHECKED_QUERY("DROP TABLE test_column.t1");
49
50- tear_down_schema();
51+ tear_down_schema("test_column");
52
53 return EXIT_SUCCESS;
54 }
55
56=== modified file 'tests/unit/common.c'
57--- tests/unit/common.c 2013-04-21 21:56:39 +0000
58+++ tests/unit/common.c 2013-04-26 19:01:27 +0000
59@@ -73,21 +73,27 @@
60 ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "%s(%s)", drizzle_error(con), drizzle_strerror(driz_ret));
61 }
62
63-void set_up_schema(void)
64+void set_up_schema(const char *schema)
65 {
66 drizzle_result_st VARIABLE_IS_NOT_USED *result;
67 drizzle_return_t driz_ret;
68-
69- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
70- CHECKED_QUERY("CREATE SCHEMA libdrizzle");
71- CHECK(drizzle_select_db(con, "libdrizzle"));
72+ char sch_query[128];
73+
74+ snprintf(sch_query, 127, "DROP SCHEMA IF EXISTS %s", schema);
75+
76+ CHECKED_QUERY(sch_query);
77+ snprintf(sch_query, 127, "CREATE SCHEMA %s", schema);
78+ CHECKED_QUERY(sch_query);
79+ CHECK(drizzle_select_db(con, schema));
80 }
81
82-void tear_down_schema(void)
83+void tear_down_schema(const char *schema)
84 {
85 drizzle_result_st VARIABLE_IS_NOT_USED *result;
86 drizzle_return_t driz_ret;
87+ char sch_query[128];
88
89- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
90+ snprintf(sch_query, 127, "DROP SCHEMA IF EXISTS %s", schema);
91+ CHECKED_QUERY(sch_query);
92 }
93
94
95=== modified file 'tests/unit/common.h'
96--- tests/unit/common.h 2013-04-21 21:41:39 +0000
97+++ tests/unit/common.h 2013-04-26 19:01:27 +0000
98@@ -61,8 +61,8 @@
99 extern void close_connection_on_exit(void);
100
101 /* For unit tests that make tables, etc.: delete-and-recreate the schema on setup, and delete the schema on teardown. */
102-extern void set_up_schema(void);
103-extern void tear_down_schema(void);
104+extern void set_up_schema(const char* schema);
105+extern void tear_down_schema(const char* schema);
106
107 /* Perform a query; assign the result to 'result' and the returncode to 'driz_ret'; assert that the returncode is DRIZZLE_RETURN_OK. */
108 #define CHECKED_QUERY(cmd) result = drizzle_query(con, cmd, 0, &driz_ret); \
109
110=== modified file 'tests/unit/datetypes.c'
111--- tests/unit/datetypes.c 2013-04-25 10:15:18 +0000
112+++ tests/unit/datetypes.c 2013-04-26 19:01:27 +0000
113@@ -85,20 +85,22 @@
114 unsigned rows_in_table;
115
116 set_up_connection();
117- set_up_schema();
118-
119- CHECKED_QUERY("create table libdrizzle.dt1 (a int primary key not null, b date, c year(4), d timestamp(0), e timestamp(6), f time(0), g time(6), h datetime(0), i datetime(6))");
120+ set_up_schema("test_datetime");
121+
122+ SKIP_IF_(drizzle_server_version_number(con) < 50604, "Test requires MySQL 5.6.4 or higher");
123+
124+ CHECKED_QUERY("create table test_datetime.dt1 (a int primary key not null, b date, c year(4), d timestamp(0), e timestamp(6), f time(0), g time(6), h datetime(0), i datetime(6))");
125 rows_in_table = 0;
126
127 /* Insert rows with pk 1 and 2 */
128- CHECKED_QUERY("insert into libdrizzle.dt1 (a,b,c,d,e,f,g,h,i) values "
129+ CHECKED_QUERY("insert into test_datetime.dt1 (a,b,c,d,e,f,g,h,i) values "
130 "(1, '1970-01-01', '2112', '2013-03-13 09:22:00.001', '2013-03-13 09:22:00.001', '6:15:03', '23:59:59.75', '1642-12-25 12:15:01', '1642-12-25 12:12:00.125'),"
131 "(2, '84-02-29', '12', NOW(), NOW(), '3 6:15:03', '23:59:59.0625', '1642-12-25 12:15:01', '1642-12-25 12:12:00.000000');");
132 ASSERT_EQ(drizzle_result_affected_rows(result), 2);
133 rows_in_table += 2;
134
135 /* Insert row with pk 3 and 4 - test marshaling values we transmit */
136- query = "insert into libdrizzle.dt1 (a,b,c,d,e,f,g,h,i) values (?,?,?,?,?,?,?,?,?)";
137+ query = "insert into test_datetime.dt1 (a,b,c,d,e,f,g,h,i) values (?,?,?,?,?,?,?,?,?)";
138 sth = drizzle_stmt_prepare(con, query, strlen(query), &driz_ret);
139 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
140
141@@ -139,7 +141,7 @@
142 CHECK(drizzle_stmt_close(sth));
143
144 /* Read the table back, with values sent over the wire in text form */
145- CHECKED_QUERY("select * from libdrizzle.dt1 order by a");
146+ CHECKED_QUERY("select * from test_datetime.dt1 order by a");
147
148 drizzle_result_buffer(result);
149 num_fields= drizzle_result_column_count(result);
150@@ -163,7 +165,7 @@
151 while ((column= drizzle_column_next(result)))
152 {
153 cur_column++;
154- ASSERT_EQ_(strcmp(drizzle_column_db(column), "libdrizzle"), 0, "Column has bad DB name");
155+ ASSERT_EQ_(strcmp(drizzle_column_db(column), "test_datetime"), 0, "Column has bad DB name");
156 ASSERT_EQ_(strcmp(drizzle_column_table(column), "dt1"), 0, "Column %d had bad table name", cur_column);
157 ASSERT_EQ(drizzle_column_current(result), cur_column);
158 ASSERT_STREQ_(drizzle_column_name(column), column_names[cur_column], "Column %d name", cur_column);
159@@ -200,7 +202,7 @@
160 drizzle_result_free(result);
161
162 /* Read the table back, with values sent over the wire in binary form */
163- query = "select a,b,c,d,e,f,g,h,i from libdrizzle.dt1 order by a";
164+ query = "select a,b,c,d,e,f,g,h,i from test_datetime.dt1 order by a";
165 sth = drizzle_stmt_prepare(con, query, strlen(query), &driz_ret);
166 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
167 driz_ret = drizzle_stmt_execute(sth);
168@@ -279,7 +281,7 @@
169 const char *col_name = column_names[checking_column];
170 char query_buf[128];
171 int VARIABLE_IS_NOT_USED unused;
172- unused = snprintf(query_buf, 128, "select a, %s, cast(%s as char) from libdrizzle.dt1",
173+ unused = snprintf(query_buf, 128, "select a, %s, cast(%s as char) from test_datetime.dt1",
174 col_name, col_name);
175 query = query_buf;
176
177@@ -323,9 +325,9 @@
178 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s", drizzle_strerror(driz_ret), drizzle_error(con));
179 }
180
181- CHECKED_QUERY("DROP TABLE libdrizzle.dt1");
182+ CHECKED_QUERY("DROP TABLE test_datetime.dt1");
183
184- tear_down_schema();
185+ tear_down_schema("test_datetime");
186
187 return EXIT_SUCCESS;
188 }
189
190=== modified file 'tests/unit/insert_id.c'
191--- tests/unit/insert_id.c 2013-03-04 22:11:55 +0000
192+++ tests/unit/insert_id.c 2013-04-26 19:01:27 +0000
193@@ -68,31 +68,31 @@
194 }
195 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
196
197- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
198-
199- CHECKED_QUERY("CREATE SCHEMA libdrizzle");
200-
201- ret= drizzle_select_db(con, "libdrizzle");
202- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
203-
204- CHECKED_QUERY("create table libdrizzle.t1 (a int primary key auto_increment, b int)");
205-
206- drizzle_result_st *result= drizzle_query(con, "insert into libdrizzle.t1 (b) values (1),(2),(3)", 0, &ret);
207+ CHECKED_QUERY("DROP SCHEMA IF EXISTS test_insert");
208+
209+ CHECKED_QUERY("CREATE SCHEMA test_insert");
210+
211+ ret= drizzle_select_db(con, "test_insert");
212+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_insert");
213+
214+ CHECKED_QUERY("create table test_insert.t1 (a int primary key auto_increment, b int)");
215+
216+ drizzle_result_st *result= drizzle_query(con, "insert into test_insert.t1 (b) values (1),(2),(3)", 0, &ret);
217 ASSERT_EQ_(ret, DRIZZLE_RETURN_OK, "insert into libdrizzle.t1 (b) values (1),(2),(3): %s", drizzle_error(con));
218 ASSERT_TRUE(result);
219
220 ASSERT_EQ_(drizzle_result_insert_id(result), 1, "Got bad insert_id (expected 1, got %"PRIu64")", drizzle_result_insert_id(result));
221 drizzle_result_free(result);
222
223- result= drizzle_query(con, "INSERT INTO libdrizzle.t1 (b) VALUES (4),(5),(6)", 0, &ret);
224- ASSERT_EQ_(ret, DRIZZLE_RETURN_OK, "INSERT INTO libdrizzle.t1 (b) VALUES (4),(5),(6): %s", drizzle_error(con));
225+ result= drizzle_query(con, "INSERT INTO test_insert.t1 (b) VALUES (4),(5),(6)", 0, &ret);
226+ ASSERT_EQ_(ret, DRIZZLE_RETURN_OK, "INSERT INTO test_insert.t1 (b) VALUES (4),(5),(6): %s", drizzle_error(con));
227
228 ASSERT_EQ_(drizzle_result_insert_id(result), 4, "Got bad insert_id (expected 4, got %"PRIu64")", drizzle_result_insert_id(result));
229 drizzle_result_free(result);
230
231- CHECKED_QUERY("DROP TABLE libdrizzle.t1");
232+ CHECKED_QUERY("DROP TABLE test_insert.t1");
233
234- CHECKED_QUERY("DROP SCHEMA libdrizzle");
235+ CHECKED_QUERY("DROP SCHEMA test_insert");
236
237 ret= drizzle_quit(con);
238 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));
239
240=== modified file 'tests/unit/nulls.c'
241--- tests/unit/nulls.c 2013-04-22 19:14:35 +0000
242+++ tests/unit/nulls.c 2013-04-26 19:01:27 +0000
243@@ -85,19 +85,19 @@
244 }
245 ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(driz_ret));
246
247- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
248-
249- CHECKED_QUERY("CREATE SCHEMA libdrizzle");
250-
251- driz_ret= drizzle_select_db(con, "libdrizzle");
252- ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "USE libdrizzle");
253-
254- CHECKED_QUERY("create table libdrizzle.t1 (a int, b int, c int, d int, e int, f int, g int, h int, i int, j int, k int)");
255+ CHECKED_QUERY("DROP SCHEMA IF EXISTS test_nulls");
256+
257+ CHECKED_QUERY("CREATE SCHEMA test_nulls");
258+
259+ driz_ret= drizzle_select_db(con, "test_nulls");
260+ ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "USE test_nulls");
261+
262+ CHECKED_QUERY("create table test_nulls.t1 (a int, b int, c int, d int, e int, f int, g int, h int, i int, j int, k int)");
263
264 #define NCOLS 11
265
266 char *querybuf = calloc(256 + 60*64, 1);
267- strcpy(querybuf, "insert into libdrizzle.t1 values ");
268+ strcpy(querybuf, "insert into test_nulls.t1 values ");
269 char *p = querybuf + strlen(querybuf);
270
271 for(int sym = 0; sym < 64; sym++) {
272@@ -121,7 +121,7 @@
273 CHECKED_QUERY(querybuf);
274
275 #ifdef TEST_PREPARED_STATEMENTS
276- strcpy(querybuf, "insert into libdrizzle.t1 values (?,?,?,?,?,?,?,?,?,?,?)");
277+ strcpy(querybuf, "insert into test_nulls.t1 values (?,?,?,?,?,?,?,?,?,?,?)");
278 sth = drizzle_stmt_prepare(con, querybuf, strlen(querybuf), &driz_ret);
279 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), querybuf);
280
281@@ -161,7 +161,7 @@
282 table_size = 64;
283 #endif
284
285- CHECKED_QUERY("select a,b,c,d,e,f,g,h,i,j,k from libdrizzle.t1 order by e");
286+ CHECKED_QUERY("select a,b,c,d,e,f,g,h,i,j,k from test_nulls.t1 order by e");
287 drizzle_result_buffer(result);
288 num_fields= drizzle_result_column_count(result);
289 ASSERT_EQ_(num_fields, NCOLS, "Bad number of fields, expected %d, got %d", 11, num_fields);
290@@ -208,7 +208,7 @@
291 drizzle_result_free(result);
292
293 #ifdef TEST_PREPARED_STATEMENTS
294- strcpy(querybuf, "select a,b,c,d,e,f,g,h,i,j,k from libdrizzle.t1 order by e");
295+ strcpy(querybuf, "select a,b,c,d,e,f,g,h,i,j,k from test_nulls.t1 order by e");
296 sth = drizzle_stmt_prepare(con, querybuf, strlen(querybuf), &driz_ret);
297 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), querybuf);
298 driz_ret = drizzle_stmt_execute(sth);
299@@ -266,10 +266,10 @@
300 ASSERT_EQ(drizzle_stmt_close(sth), DRIZZLE_RETURN_OK);
301 #endif
302
303- CHECKED_QUERY("DROP TABLE libdrizzle.t1");
304- ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "DROP TABLE libdrizzle.t1");
305+ CHECKED_QUERY("DROP TABLE test_nulls.t1");
306+ ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "DROP TABLE test_nulls.t1");
307
308- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
309+ CHECKED_QUERY("DROP SCHEMA IF EXISTS test_nulls");
310
311 driz_ret= drizzle_quit(con);
312 ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "%s", drizzle_strerror(driz_ret));
313
314=== modified file 'tests/unit/numbers.c'
315--- tests/unit/numbers.c 2013-04-21 21:41:39 +0000
316+++ tests/unit/numbers.c 2013-04-26 19:01:27 +0000
317@@ -89,20 +89,20 @@
318 int num_fields;
319
320 set_up_connection();
321- set_up_schema();
322+ set_up_schema("test_numbers");
323
324- CHECKED_QUERY("create table libdrizzle.t1 (a int primary key auto_increment, b tinyint, c smallint, d mediumint, e int, f bigint, g float, h double)");
325+ CHECKED_QUERY("create table test_numbers.t1 (a int primary key auto_increment, b tinyint, c smallint, d mediumint, e int, f bigint, g float, h double)");
326
327 /* Insert rows with pk 1 and 2 */
328- CHECKED_QUERY("insert into libdrizzle.t1 (b,c,d,e,f,g,h) values (1,1,1,1,1,1,1), (127,32687,8388351,2147352575,9222246136947920895,443664,291.2711110711098);");
329+ CHECKED_QUERY("insert into test_numbers.t1 (b,c,d,e,f,g,h) values (1,1,1,1,1,1,1), (127,32687,8388351,2147352575,9222246136947920895,443664,291.2711110711098);");
330 ASSERT_EQ(drizzle_result_affected_rows(result), 2);
331
332 /* Insert row with pk 3 */
333- CHECKED_QUERY("insert into libdrizzle.t1 (b,c,d,e,f,g,h) ( select 0-b, 0-c, 0-d, 0-e, 0-f, g+1.015625, h+1 from t1 where a = 2 );");
334+ CHECKED_QUERY("insert into test_numbers.t1 (b,c,d,e,f,g,h) ( select 0-b, 0-c, 0-d, 0-e, 0-f, g+1.015625, h+1 from t1 where a = 2 );");
335 ASSERT_EQ(drizzle_result_affected_rows(result), 1);
336
337 /* Insert row with pk 4 - test marshaling values we transmit */
338- query = "insert into libdrizzle.t1 (b,c,d,e,f,g,h) values (?,?,?,?,?,?,?)";
339+ query = "insert into test_numbers.t1 (b,c,d,e,f,g,h) values (?,?,?,?,?,?,?)";
340 sth = drizzle_stmt_prepare(con, query, strlen(query), &driz_ret);
341 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
342 CHECK(drizzle_stmt_set_tiny(sth, 0, 127, 0));
343@@ -121,7 +121,7 @@
344 /* TODO: Also send some negative values of each type */
345
346 /* Read the table back, with values sent over the wire in text form */
347- CHECKED_QUERY("select * from libdrizzle.t1 order by b, a");
348+ CHECKED_QUERY("select * from test_numbers.t1 order by b, a");
349
350 drizzle_result_buffer(result);
351 num_fields= drizzle_result_column_count(result);
352@@ -147,7 +147,7 @@
353 while ((column= drizzle_column_next(result)))
354 {
355 cur_column++;
356- ASSERT_EQ_(strcmp(drizzle_column_db(column), "libdrizzle"), 0, "Column has bad DB name");
357+ ASSERT_EQ_(strcmp(drizzle_column_db(column), "test_numbers"), 0, "Column has bad DB name");
358 ASSERT_EQ_(strcmp(drizzle_column_table(column), "t1"), 0, "Column had bad table name");
359 ASSERT_EQ(drizzle_column_current(result), cur_column);
360 ASSERT_STREQ(drizzle_column_name(column), column_names[cur_column]);
361@@ -187,7 +187,7 @@
362 drizzle_result_free(result);
363
364 /* Read the table back, with values sent over the wire in binary form */
365- query = "select a,b,c,d,e,f,g,h from libdrizzle.t1";
366+ query = "select a,b,c,d,e,f,g,h from test_numbers.t1";
367 sth = drizzle_stmt_prepare(con, query, strlen(query), &driz_ret);
368 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, preparing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
369 driz_ret = drizzle_stmt_execute(sth);
370@@ -317,10 +317,10 @@
371 driz_ret = drizzle_stmt_close(sth);
372 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s", drizzle_strerror(driz_ret), drizzle_error(con));
373
374- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &driz_ret);
375- ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "DROP TABLE libdrizzle.t1");
376+ drizzle_query(con, "DROP TABLE test_numbers.t1", 0, &driz_ret);
377+ ASSERT_EQ_(DRIZZLE_RETURN_OK, driz_ret, "DROP TABLE test_numbers.t1");
378
379- tear_down_schema();
380+ tear_down_schema("test_numbers");
381
382 return EXIT_SUCCESS;
383 }
384
385=== modified file 'tests/unit/query.c'
386--- tests/unit/query.c 2013-03-04 22:11:55 +0000
387+++ tests/unit/query.c 2013-04-26 19:01:27 +0000
388@@ -68,28 +68,28 @@
389 }
390 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(ret));
391
392- CHECKED_QUERY("DROP SCHEMA IF EXISTS libdrizzle");
393-
394- CHECKED_QUERY("CREATE SCHEMA libdrizzle");
395-
396- ret= drizzle_select_db(con, "libdrizzle");
397- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
398-
399- drizzle_query(con, "create table libdrizzle.t1 (a int)", 0, &ret);
400+ CHECKED_QUERY("DROP SCHEMA IF EXISTS test_query");
401+
402+ CHECKED_QUERY("CREATE SCHEMA test_query");
403+
404+ ret= drizzle_select_db(con, "test_query");
405+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_query");
406+
407+ drizzle_query(con, "create table test_query.t1 (a int)", 0, &ret);
408 if (ret != DRIZZLE_RETURN_OK)
409 {
410 printf("Create table failure\n");
411 return EXIT_FAILURE;
412 }
413
414- drizzle_query(con, "insert into libdrizzle.t1 values (1),(2),(3)", 0, &ret);
415+ drizzle_query(con, "insert into test_query.t1 values (1),(2),(3)", 0, &ret);
416 if (ret != DRIZZLE_RETURN_OK)
417 {
418 printf("Insert failure\n");
419 return EXIT_FAILURE;
420 }
421
422- drizzle_result_st *result= drizzle_query(con, "select * from libdrizzle.t1", 0, &ret);
423+ drizzle_result_st *result= drizzle_query(con, "select * from test_query.t1", 0, &ret);
424 if (ret != DRIZZLE_RETURN_OK)
425 {
426 printf("Select failure\n");
427@@ -124,11 +124,11 @@
428
429 drizzle_result_free(result);
430
431- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &ret);
432- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE libdrizzle.t1");
433+ drizzle_query(con, "DROP TABLE test_query.t1", 0, &ret);
434+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE test_query.t1");
435
436- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
437- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA libdrizzle (%s)", drizzle_error(con));
438+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_query", 0, &ret);
439+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA test_query (%s)", drizzle_error(con));
440
441 ret= drizzle_quit(con);
442 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));
443
444=== modified file 'tests/unit/row.c'
445--- tests/unit/row.c 2013-01-27 09:48:19 +0000
446+++ tests/unit/row.c 2013-04-26 19:01:27 +0000
447@@ -66,30 +66,30 @@
448 }
449 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(ret));
450
451- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
452- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
453-
454- drizzle_query(con, "CREATE SCHEMA libdrizzle", 0, &ret);
455- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
456-
457- ret= drizzle_select_db(con, "libdrizzle");
458- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
459-
460- drizzle_query(con, "create table libdrizzle.t1 (a int)", 0, &ret);
461+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_row", 0, &ret);
462+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_row (%s)", drizzle_error(con));
463+
464+ drizzle_query(con, "CREATE SCHEMA test_row", 0, &ret);
465+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_row (%s)", drizzle_error(con));
466+
467+ ret= drizzle_select_db(con, "test_row");
468+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_row");
469+
470+ drizzle_query(con, "create table test_row.t1 (a int)", 0, &ret);
471 if (ret != DRIZZLE_RETURN_OK)
472 {
473 printf("Create table failure\n");
474 return EXIT_FAILURE;
475 }
476
477- drizzle_query(con, "insert into libdrizzle.t1 values (1),(2),(3)", 0, &ret);
478+ drizzle_query(con, "insert into test_row.t1 values (1),(2),(3)", 0, &ret);
479 if (ret != DRIZZLE_RETURN_OK)
480 {
481 printf("Insert failure\n");
482 return EXIT_FAILURE;
483 }
484
485- drizzle_result_st *result= drizzle_query(con, "select * from libdrizzle.t1", 0, &ret);
486+ drizzle_result_st *result= drizzle_query(con, "select * from test_row.t1", 0, &ret);
487 if (ret != DRIZZLE_RETURN_OK)
488 {
489 printf("Select failure\n");
490@@ -148,11 +148,11 @@
491
492 drizzle_result_free(result);
493
494- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &ret);
495- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE libdrizzle.t1");
496+ drizzle_query(con, "DROP TABLE test_row.t1", 0, &ret);
497+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE test_row.t1");
498
499- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
500- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA libdrizzle (%s)", drizzle_error(con));
501+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_row", 0, &ret);
502+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA test_row (%s)", drizzle_error(con));
503
504 ret= drizzle_quit(con);
505 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));
506
507=== modified file 'tests/unit/statement.c'
508--- tests/unit/statement.c 2013-02-27 19:08:06 +0000
509+++ tests/unit/statement.c 2013-04-26 19:01:27 +0000
510@@ -70,22 +70,22 @@
511 }
512 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(ret));
513
514- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
515- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
516-
517- drizzle_query(con, "CREATE SCHEMA libdrizzle", 0, &ret);
518- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
519-
520- ret= drizzle_select_db(con, "libdrizzle");
521- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
522-
523- drizzle_query(con, "create table libdrizzle.t1 (a int)", 0, &ret);
524- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "create table libdrizzle.t1 (a int): %s", drizzle_error(con));
525-
526- drizzle_query(con, "insert into libdrizzle.t1 values (1),(2),(3)", 0, &ret);
527+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_stmt", 0, &ret);
528+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_stmt (%s)", drizzle_error(con));
529+
530+ drizzle_query(con, "CREATE SCHEMA test_stmt", 0, &ret);
531+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_stmt (%s)", drizzle_error(con));
532+
533+ ret= drizzle_select_db(con, "test_stmt");
534+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_stmt");
535+
536+ drizzle_query(con, "create table test_stmt.t1 (a int)", 0, &ret);
537+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "create table test_stmt.t1 (a int): %s", drizzle_error(con));
538+
539+ drizzle_query(con, "insert into test_stmt.t1 values (1),(2),(3)", 0, &ret);
540 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
541
542- const char *query= "select * from libdrizzle.t1 where a > ?";
543+ const char *query= "select * from test_stmt.t1 where a > ?";
544 stmt= drizzle_stmt_prepare(con, query, strlen(query), &ret);
545 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
546
547@@ -146,11 +146,11 @@
548 ret = drizzle_stmt_close(stmt);
549 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
550
551- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &ret);
552- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE libdrizzle.t1");
553+ drizzle_query(con, "DROP TABLE test_stmt.t1", 0, &ret);
554+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE test_stmt.t1");
555
556- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
557- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA libdrizzle (%s)", drizzle_error(con));
558+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_stmt", 0, &ret);
559+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA test_stmt (%s)", drizzle_error(con));
560
561 ret= drizzle_quit(con);
562 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));
563
564=== modified file 'tests/unit/statement_char.c'
565--- tests/unit/statement_char.c 2013-01-27 09:48:19 +0000
566+++ tests/unit/statement_char.c 2013-04-26 19:01:27 +0000
567@@ -70,22 +70,22 @@
568 }
569 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(ret));
570
571- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
572- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
573-
574- drizzle_query(con, "CREATE SCHEMA libdrizzle", 0, &ret);
575- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
576-
577- ret= drizzle_select_db(con, "libdrizzle");
578- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
579-
580- drizzle_query(con, "create table libdrizzle.t1 (a varchar(50))", 0, &ret);
581- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "create table libdrizzle.t1 (a int): %s", drizzle_error(con));
582-
583- drizzle_query(con, "insert into libdrizzle.t1 values ('hello'),('drizzle'),('people')", 0, &ret);
584+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_stmt_ch", 0, &ret);
585+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_stmt_ch (%s)", drizzle_error(con));
586+
587+ drizzle_query(con, "CREATE SCHEMA test_stmt_ch", 0, &ret);
588+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_stmt_ch (%s)", drizzle_error(con));
589+
590+ ret= drizzle_select_db(con, "test_stmt_ch");
591+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_stmt_ch");
592+
593+ drizzle_query(con, "create table test_stmt_ch.t1 (a varchar(50))", 0, &ret);
594+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "create table test_stmt_ch.t1 (a int): %s", drizzle_error(con));
595+
596+ drizzle_query(con, "insert into test_stmt_ch.t1 values ('hello'),('drizzle'),('people')", 0, &ret);
597 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
598
599- const char *query= "select * from libdrizzle.t1 where a = ?";
600+ const char *query= "select * from test_stmt_ch.t1 where a = ?";
601 stmt= drizzle_stmt_prepare(con, query, strlen(query), &ret);
602 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_error(con));
603
604@@ -141,11 +141,11 @@
605 ret = drizzle_stmt_close(stmt);
606 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_stmt_close() %s", drizzle_error(con));
607
608- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &ret);
609- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE libdrizzle.t1");
610+ drizzle_query(con, "DROP TABLE test_stmt_ch.t1", 0, &ret);
611+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE test_stmt_ch.t1");
612
613- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
614- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA libdrizzle (%s)", drizzle_error(con));
615+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_stmt_ch", 0, &ret);
616+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA test_stmt_ch (%s)", drizzle_error(con));
617
618 ret= drizzle_quit(con);
619 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));
620
621=== modified file 'tests/unit/unbuffered_query.c'
622--- tests/unit/unbuffered_query.c 2013-01-27 09:48:19 +0000
623+++ tests/unit/unbuffered_query.c 2013-04-26 19:01:27 +0000
624@@ -66,30 +66,30 @@
625 }
626 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "drizzle_connect(): %s(%s)", drizzle_error(con), drizzle_strerror(ret));
627
628- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
629- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
630-
631- drizzle_query(con, "CREATE SCHEMA libdrizzle", 0, &ret);
632- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA libdrizzle (%s)", drizzle_error(con));
633-
634- ret= drizzle_select_db(con, "libdrizzle");
635- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE libdrizzle");
636-
637- drizzle_query(con, "create table libdrizzle.t1 (a int)", 0, &ret);
638+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_unbuff", 0, &ret);
639+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_unbuff (%s)", drizzle_error(con));
640+
641+ drizzle_query(con, "CREATE SCHEMA test_unbuff", 0, &ret);
642+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "CREATE SCHEMA test_unbuff (%s)", drizzle_error(con));
643+
644+ ret= drizzle_select_db(con, "test_unbuff");
645+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "USE test_unbuff");
646+
647+ drizzle_query(con, "create table test_unbuff.t1 (a int)", 0, &ret);
648 if (ret != DRIZZLE_RETURN_OK)
649 {
650 printf("Create table failure\n");
651 return EXIT_FAILURE;
652 }
653
654- drizzle_query(con, "insert into libdrizzle.t1 values (1),(2),(3)", 0, &ret);
655+ drizzle_query(con, "insert into test_unbuff.t1 values (1),(2),(3)", 0, &ret);
656 if (ret != DRIZZLE_RETURN_OK)
657 {
658 printf("Insert failure\n");
659 return EXIT_FAILURE;
660 }
661
662- drizzle_result_st *result= drizzle_query(con, "select * from libdrizzle.t1", 0, &ret);
663+ drizzle_result_st *result= drizzle_query(con, "select * from test_unbuff.t1", 0, &ret);
664 if (ret != DRIZZLE_RETURN_OK)
665 {
666 printf("Select failure\n");
667@@ -142,11 +142,11 @@
668
669 drizzle_result_free(result);
670
671- drizzle_query(con, "DROP TABLE libdrizzle.t1", 0, &ret);
672- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE libdrizzle.t1");
673+ drizzle_query(con, "DROP TABLE test_unbuff.t1", 0, &ret);
674+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP TABLE test_unbuff.t1");
675
676- drizzle_query(con, "DROP SCHEMA IF EXISTS libdrizzle", 0, &ret);
677- ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA libdrizzle (%s)", drizzle_error(con));
678+ drizzle_query(con, "DROP SCHEMA IF EXISTS test_unbuff", 0, &ret);
679+ ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "DROP SCHEMA test_unbuff (%s)", drizzle_error(con));
680
681 ret= drizzle_quit(con);
682 ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret));

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: