Merge lp:~hartmut-php/drizzle/drizzle-fix-mysql-bug44732 into lp:~drizzle-trunk/drizzle/development

Proposed by Hartmut Holzgraefe
Status: Merged
Merged at revision: 1563
Proposed branch: lp:~hartmut-php/drizzle/drizzle-fix-mysql-bug44732
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 36 lines (+13/-3)
1 file modified
client/drizzle.cc (+13/-3)
To merge this branch: bzr merge lp:~hartmut-php/drizzle/drizzle-fix-mysql-bug44732
Reviewer Review Type Date Requested Status
Monty Taylor Approve
Review via email: mp+25721@code.launchpad.net

Description of the change

fix for mysql bug #44732 "mysql client should printing warnings on stderr in batch mode"
which is also present in the drizzle client

To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

Totally.

review: Approve

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 2010-05-13 07:58:04 +0000
3+++ client/drizzle.cc 2010-05-20 21:11:29 +0000
4@@ -3446,6 +3446,7 @@
5 drizzle_row_t cur;
6 uint64_t num_rows;
7 uint32_t new_code= 0;
8+ FILE *out;
9
10 /* Get the warnings */
11 query= "show warnings";
12@@ -3471,12 +3472,21 @@
13 }
14
15 /* Print the warnings */
16- init_pager();
17+ if (status.getBatch())
18+ {
19+ out = stderr;
20+ }
21+ else
22+ {
23+ init_pager();
24+ out = PAGER;
25+ }
26 do
27 {
28- tee_fprintf(PAGER, "%s (Code %s): %s\n", cur[0], cur[1], cur[2]);
29+ tee_fprintf(out, "%s (Code %s): %s\n", cur[0], cur[1], cur[2]);
30 } while ((cur= drizzle_row_next(&result)));
31- end_pager();
32+ if (!status.getBatch())
33+ end_pager();
34
35 end:
36 drizzle_result_free(&result);