Merge lp:~linuxjedi/libdrizzle/5.1-fix-mingw into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 112
Merged at revision: 113
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-fix-mingw
Merge into: lp:libdrizzle
Diff against target: 46 lines (+4/-6)
2 files modified
libdrizzle/statement_param.cc (+2/-2)
tests/unit/datetypes.c (+2/-4)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-fix-mingw
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+160490@code.launchpad.net

Description of the change

Replaces 2 functions which break mingw compatibility

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
=== modified file 'libdrizzle/statement_param.cc'
--- libdrizzle/statement_param.cc 2013-04-22 18:32:01 +0000
+++ libdrizzle/statement_param.cc 2013-04-23 20:35:39 +0000
@@ -129,7 +129,7 @@
129 drizzle_datetime_st *time;129 drizzle_datetime_st *time;
130 time= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;130 time= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;
131131
132 bzero(time, sizeof(*time));132 memset(time, 0, sizeof(*time));
133133
134 time->negative= is_negative;134 time->negative= is_negative;
135 time->day= days;135 time->day= days;
@@ -147,7 +147,7 @@
147 drizzle_datetime_st *timestamp;147 drizzle_datetime_st *timestamp;
148 timestamp= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;148 timestamp= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;
149149
150 bzero(timestamp, sizeof(*timestamp));150 memset(timestamp, 0, sizeof(*timestamp));
151151
152 timestamp->negative= false;152 timestamp->negative= false;
153 timestamp->year= year;153 timestamp->year= year;
154154
=== modified file 'tests/unit/datetypes.c'
--- tests/unit/datetypes.c 2013-04-21 21:41:39 +0000
+++ tests/unit/datetypes.c 2013-04-23 20:35:39 +0000
@@ -277,9 +277,9 @@
277 /* Check that libdrizzle stringifies values the same way the server does */277 /* Check that libdrizzle stringifies values the same way the server does */
278 for (unsigned checking_column = 2; checking_column < 10; checking_column ++) {278 for (unsigned checking_column = 2; checking_column < 10; checking_column ++) {
279 const char *col_name = column_names[checking_column];279 const char *col_name = column_names[checking_column];
280 char *query_buf = NULL;280 char query_buf[128];
281 int VARIABLE_IS_NOT_USED unused;281 int VARIABLE_IS_NOT_USED unused;
282 unused = asprintf(&query_buf, "select a, %s, cast(%s as char) from libdrizzle.dt1",282 unused = snprintf(query_buf, 128, "select a, %s, cast(%s as char) from libdrizzle.dt1",
283 col_name, col_name);283 col_name, col_name);
284 query = query_buf;284 query = query_buf;
285285
@@ -290,8 +290,6 @@
290 driz_ret = drizzle_stmt_buffer(sth);290 driz_ret = drizzle_stmt_buffer(sth);
291 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, buffering \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);291 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, buffering \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
292 292
293 free(query_buf);
294 query_buf = NULL;
295 query = NULL;293 query = NULL;
296294
297 ASSERT_EQ(rows_in_table, drizzle_stmt_row_count(sth));295 ASSERT_EQ(rows_in_table, drizzle_stmt_row_count(sth));

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: