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
1=== modified file 'libdrizzle/statement_param.cc'
2--- libdrizzle/statement_param.cc 2013-04-22 18:32:01 +0000
3+++ libdrizzle/statement_param.cc 2013-04-23 20:35:39 +0000
4@@ -129,7 +129,7 @@
5 drizzle_datetime_st *time;
6 time= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;
7
8- bzero(time, sizeof(*time));
9+ memset(time, 0, sizeof(*time));
10
11 time->negative= is_negative;
12 time->day= days;
13@@ -147,7 +147,7 @@
14 drizzle_datetime_st *timestamp;
15 timestamp= (drizzle_datetime_st*) stmt->query_params[param_num].data_buffer;
16
17- bzero(timestamp, sizeof(*timestamp));
18+ memset(timestamp, 0, sizeof(*timestamp));
19
20 timestamp->negative= false;
21 timestamp->year= year;
22
23=== modified file 'tests/unit/datetypes.c'
24--- tests/unit/datetypes.c 2013-04-21 21:41:39 +0000
25+++ tests/unit/datetypes.c 2013-04-23 20:35:39 +0000
26@@ -277,9 +277,9 @@
27 /* Check that libdrizzle stringifies values the same way the server does */
28 for (unsigned checking_column = 2; checking_column < 10; checking_column ++) {
29 const char *col_name = column_names[checking_column];
30- char *query_buf = NULL;
31+ char query_buf[128];
32 int VARIABLE_IS_NOT_USED unused;
33- unused = asprintf(&query_buf, "select a, %s, cast(%s as char) from libdrizzle.dt1",
34+ unused = snprintf(query_buf, 128, "select a, %s, cast(%s as char) from libdrizzle.dt1",
35 col_name, col_name);
36 query = query_buf;
37
38@@ -290,8 +290,6 @@
39 driz_ret = drizzle_stmt_buffer(sth);
40 ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, buffering \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query);
41
42- free(query_buf);
43- query_buf = NULL;
44 query = NULL;
45
46 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: