Merge lp:~brianaker/libdrizzle/private-headers-connection-test into lp:libdrizzle
- private-headers-connection-test
- Merge into libdrizzle-redux
Proposed by
Brian Aker
Status: | Merged |
---|---|
Merged at revision: | 74 |
Proposed branch: | lp:~brianaker/libdrizzle/private-headers-connection-test |
Merge into: | lp:libdrizzle |
Diff against target: |
643 lines (+226/-109) 21 files modified
libdrizzle-5.1/binlog.h (+0/-3) libdrizzle-5.1/column.h (+0/-12) libdrizzle-5.1/conn.h (+1/-44) libdrizzle-5.1/drizzle.h (+0/-24) libdrizzle-5.1/result.h (+0/-6) libdrizzle/binlog.h (+41/-0) libdrizzle/column.h (+49/-0) libdrizzle/common.h (+2/-0) libdrizzle/conn.cc (+2/-2) libdrizzle/conn_local.h (+38/-2) libdrizzle/drizzle_local.h (+30/-6) libdrizzle/include.am (+3/-1) rpm/spec.in (+0/-1) tests/unit/binlog.c (+6/-1) tests/unit/column.c (+5/-1) tests/unit/connect.c (+24/-1) tests/unit/insert_id.c (+5/-1) tests/unit/query.c (+5/-1) tests/unit/row.c (+5/-1) tests/unit/statement.c (+5/-1) tests/unit/unbuffered_query.c (+5/-1) |
To merge this branch: | bzr merge lp:~brianaker/libdrizzle/private-headers-connection-test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Hutchings | Needs Fixing | ||
Review via email: mp+141484@code.launchpad.net |
Commit message
Description of the change
Make all local private in headers, and add a connection loop test.
To post a comment you must log in.
- 75. By Brian Aker
-
Update to check env for settings.
- 76. By Brian Aker
-
Fix rpm, move local binlog call to private headers.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'libdrizzle-5.1/binlog.h' | |||
2 | --- libdrizzle-5.1/binlog.h 2012-12-22 08:54:15 +0000 | |||
3 | +++ libdrizzle-5.1/binlog.h 2012-12-31 00:24:23 +0000 | |||
4 | @@ -81,9 +81,6 @@ | |||
5 | 81 | DRIZZLE_API | 81 | DRIZZLE_API |
6 | 82 | uint32_t drizzle_binlog_event_raw_length(drizzle_result_st *result); | 82 | uint32_t drizzle_binlog_event_raw_length(drizzle_result_st *result); |
7 | 83 | 83 | ||
8 | 84 | DRIZZLE_LOCAL | ||
9 | 85 | drizzle_return_t drizzle_state_binlog_read(drizzle_st *con); | ||
10 | 86 | |||
11 | 87 | #ifdef __cplusplus | 84 | #ifdef __cplusplus |
12 | 88 | } | 85 | } |
13 | 89 | #endif | 86 | #endif |
14 | 90 | 87 | ||
15 | === modified file 'libdrizzle-5.1/column.h' | |||
16 | --- libdrizzle-5.1/column.h 2012-12-18 11:36:28 +0000 | |||
17 | +++ libdrizzle-5.1/column.h 2012-12-31 00:24:23 +0000 | |||
18 | @@ -58,12 +58,6 @@ | |||
19 | 58 | */ | 58 | */ |
20 | 59 | 59 | ||
21 | 60 | /** | 60 | /** |
22 | 61 | * Initialize a column structure. | ||
23 | 62 | */ | ||
24 | 63 | DRIZZLE_LOCAL | ||
25 | 64 | drizzle_column_st *drizzle_column_create(drizzle_result_st *result); | ||
26 | 65 | |||
27 | 66 | /** | ||
28 | 67 | * Free a column structure. | 61 | * Free a column structure. |
29 | 68 | */ | 62 | */ |
30 | 69 | DRIZZLE_API | 63 | DRIZZLE_API |
31 | @@ -154,12 +148,6 @@ | |||
32 | 154 | const uint8_t *drizzle_column_default_value(drizzle_column_st *column, | 148 | const uint8_t *drizzle_column_default_value(drizzle_column_st *column, |
33 | 155 | size_t *size); | 149 | size_t *size); |
34 | 156 | 150 | ||
35 | 157 | DRIZZLE_LOCAL | ||
36 | 158 | void drizzle_column_set_default_value(drizzle_column_st *column, | ||
37 | 159 | const uint8_t *default_value, | ||
38 | 160 | size_t size); | ||
39 | 161 | |||
40 | 162 | |||
41 | 163 | /** @} */ | 151 | /** @} */ |
42 | 164 | 152 | ||
43 | 165 | #ifdef __cplusplus | 153 | #ifdef __cplusplus |
44 | 166 | 154 | ||
45 | === modified file 'libdrizzle-5.1/conn.h' | |||
46 | --- libdrizzle-5.1/conn.h 2012-12-22 08:54:15 +0000 | |||
47 | +++ libdrizzle-5.1/conn.h 2012-12-31 00:24:23 +0000 | |||
48 | @@ -68,7 +68,7 @@ | |||
49 | 68 | * @param[in] con Connection structure previously initialized with | 68 | * @param[in] con Connection structure previously initialized with |
50 | 69 | * drizzle_create(), drizzle_clone(), or related functions. | 69 | * drizzle_create(), drizzle_clone(), or related functions. |
51 | 70 | */ | 70 | */ |
53 | 71 | DRIZZLE_LOCAL | 71 | DRIZZLE_API |
54 | 72 | void drizzle_close(drizzle_st *con); | 72 | void drizzle_close(drizzle_st *con); |
55 | 73 | 73 | ||
56 | 74 | /** | 74 | /** |
57 | @@ -198,27 +198,6 @@ | |||
58 | 198 | in_port_t drizzle_port(const drizzle_st *con); | 198 | in_port_t drizzle_port(const drizzle_st *con); |
59 | 199 | 199 | ||
60 | 200 | /** | 200 | /** |
61 | 201 | * Set TCP host and port for a connection. | ||
62 | 202 | * | ||
63 | 203 | * @param[in] con Connection structure previously initialized with | ||
64 | 204 | * drizzle_create(), drizzle_clone(), or related functions. | ||
65 | 205 | * @param[in] host Host to use for this connection, NULL for default value. | ||
66 | 206 | * @param[in] port Port to use for this connection, 0 for default value. | ||
67 | 207 | */ | ||
68 | 208 | DRIZZLE_LOCAL | ||
69 | 209 | void drizzle_set_tcp(drizzle_st *con, const char *host, in_port_t port); | ||
70 | 210 | |||
71 | 211 | /** | ||
72 | 212 | * Get unix domain socket for a connection. | ||
73 | 213 | * | ||
74 | 214 | * @param[in] con Connection structure previously initialized with | ||
75 | 215 | * drizzle_create(), drizzle_clone(), or related functions. | ||
76 | 216 | * @return Unix domain socket set for this connection, NULL if not set. | ||
77 | 217 | */ | ||
78 | 218 | DRIZZLE_LOCAL | ||
79 | 219 | const char *drizzle_uds(const drizzle_st *con); | ||
80 | 220 | |||
81 | 221 | /** | ||
82 | 222 | * Set unix domain socket for a connection. | 201 | * Set unix domain socket for a connection. |
83 | 223 | * | 202 | * |
84 | 224 | * @param[in] con Connection structure previously initialized with | 203 | * @param[in] con Connection structure previously initialized with |
85 | @@ -240,18 +219,6 @@ | |||
86 | 240 | const char *drizzle_user(const drizzle_st *con); | 219 | const char *drizzle_user(const drizzle_st *con); |
87 | 241 | 220 | ||
88 | 242 | /** | 221 | /** |
89 | 243 | * Set username and password for a connection. | ||
90 | 244 | * | ||
91 | 245 | * @param[in] con Connection structure previously initialized with | ||
92 | 246 | * drizzle_create(), drizzle_clone(), or related functions. | ||
93 | 247 | * @param[in] user Username to use for this connection. | ||
94 | 248 | * @param[in] password Password to use for this connection. | ||
95 | 249 | */ | ||
96 | 250 | DRIZZLE_LOCAL | ||
97 | 251 | void drizzle_set_auth(drizzle_st *con, const char *user, | ||
98 | 252 | const char *password); | ||
99 | 253 | |||
100 | 254 | /** | ||
101 | 255 | * Get database for a connection. | 222 | * Get database for a connection. |
102 | 256 | * | 223 | * |
103 | 257 | * @param[in] con Connection structure previously initialized with | 224 | * @param[in] con Connection structure previously initialized with |
104 | @@ -262,16 +229,6 @@ | |||
105 | 262 | const char *drizzle_db(const drizzle_st *con); | 229 | const char *drizzle_db(const drizzle_st *con); |
106 | 263 | 230 | ||
107 | 264 | /** | 231 | /** |
108 | 265 | * Set database for a connection. | ||
109 | 266 | * | ||
110 | 267 | * @param[in] con Connection structure previously initialized with | ||
111 | 268 | * drizzle_create(), drizzle_clone(), or related functions. | ||
112 | 269 | * @param[in] db Database to use with this connection. | ||
113 | 270 | */ | ||
114 | 271 | DRIZZLE_LOCAL | ||
115 | 272 | void drizzle_set_db(drizzle_st *con, const char *db); | ||
116 | 273 | |||
117 | 274 | /** | ||
118 | 275 | * Get application context pointer for a connection. | 232 | * Get application context pointer for a connection. |
119 | 276 | * | 233 | * |
120 | 277 | * @param[in] con Connection structure previously initialized with | 234 | * @param[in] con Connection structure previously initialized with |
121 | 278 | 235 | ||
122 | === modified file 'libdrizzle-5.1/drizzle.h' | |||
123 | --- libdrizzle-5.1/drizzle.h 2012-12-30 02:23:50 +0000 | |||
124 | +++ libdrizzle-5.1/drizzle.h 2012-12-31 00:24:23 +0000 | |||
125 | @@ -210,30 +210,6 @@ | |||
126 | 210 | DRIZZLE_API | 210 | DRIZZLE_API |
127 | 211 | void drizzle_set_log_fn(drizzle_st *con, drizzle_log_fn *function, | 211 | void drizzle_set_log_fn(drizzle_st *con, drizzle_log_fn *function, |
128 | 212 | void *context); | 212 | void *context); |
129 | 213 | |||
130 | 214 | /** | ||
131 | 215 | * Initialize a connection structure. Always check the return value even if | ||
132 | 216 | * passing in a pre-allocated structure. Some other initialization may have | ||
133 | 217 | * failed. | ||
134 | 218 | * | ||
135 | 219 | * @param[in] drizzle Drizzle structure previously initialized with | ||
136 | 220 | * drizzle_create() or drizzle_clone(). | ||
137 | 221 | * @param[in] con Caller allocated structure, or NULL to allocate one. | ||
138 | 222 | * @return On success, a pointer to the (possibly allocated) structure. On | ||
139 | 223 | * failure this will be NULL. | ||
140 | 224 | */ | ||
141 | 225 | DRIZZLE_LOCAL | ||
142 | 226 | drizzle_st *drizzle_create(void); | ||
143 | 227 | |||
144 | 228 | /** | ||
145 | 229 | * Free a connection structure. | ||
146 | 230 | * | ||
147 | 231 | * @param[in] con Connection structure previously initialized with | ||
148 | 232 | * drizzle_create(), drizzle_clone(), or related functions. | ||
149 | 233 | */ | ||
150 | 234 | DRIZZLE_LOCAL | ||
151 | 235 | void drizzle_free(drizzle_st *con); | ||
152 | 236 | |||
153 | 237 | /** | 213 | /** |
154 | 238 | * Wait for I/O on connections. | 214 | * Wait for I/O on connections. |
155 | 239 | * | 215 | * |
156 | 240 | 216 | ||
157 | === modified file 'libdrizzle-5.1/result.h' | |||
158 | --- libdrizzle-5.1/result.h 2012-12-22 08:54:15 +0000 | |||
159 | +++ libdrizzle-5.1/result.h 2012-12-31 00:24:23 +0000 | |||
160 | @@ -55,12 +55,6 @@ | |||
161 | 55 | */ | 55 | */ |
162 | 56 | 56 | ||
163 | 57 | /** | 57 | /** |
164 | 58 | * Initialize a result structure. | ||
165 | 59 | */ | ||
166 | 60 | DRIZZLE_LOCAL | ||
167 | 61 | drizzle_result_st *drizzle_result_create(drizzle_st *con); | ||
168 | 62 | |||
169 | 63 | /** | ||
170 | 64 | * Free a result structure. | 58 | * Free a result structure. |
171 | 65 | */ | 59 | */ |
172 | 66 | DRIZZLE_API | 60 | DRIZZLE_API |
173 | 67 | 61 | ||
174 | === added file 'libdrizzle/binlog.h' | |||
175 | --- libdrizzle/binlog.h 1970-01-01 00:00:00 +0000 | |||
176 | +++ libdrizzle/binlog.h 2012-12-31 00:24:23 +0000 | |||
177 | @@ -0,0 +1,41 @@ | |||
178 | 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
179 | 2 | * | ||
180 | 3 | * Drizzle Client & Protocol Library | ||
181 | 4 | * | ||
182 | 5 | * Copyright (C) 2012 Andrew Hutchings (andrew@linuxjedi.co.uk) | ||
183 | 6 | * All rights reserved. | ||
184 | 7 | * | ||
185 | 8 | * Redistribution and use in source and binary forms, with or without | ||
186 | 9 | * modification, are permitted provided that the following conditions are | ||
187 | 10 | * met: | ||
188 | 11 | * | ||
189 | 12 | * * Redistributions of source code must retain the above copyright | ||
190 | 13 | * notice, this list of conditions and the following disclaimer. | ||
191 | 14 | * | ||
192 | 15 | * * Redistributions in binary form must reproduce the above | ||
193 | 16 | * copyright notice, this list of conditions and the following disclaimer | ||
194 | 17 | * in the documentation and/or other materials provided with the | ||
195 | 18 | * distribution. | ||
196 | 19 | * | ||
197 | 20 | * * The names of its contributors may not be used to endorse or | ||
198 | 21 | * promote products derived from this software without specific prior | ||
199 | 22 | * written permission. | ||
200 | 23 | * | ||
201 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
202 | 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
203 | 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
204 | 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
205 | 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
206 | 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
207 | 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
208 | 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
209 | 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
210 | 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
211 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
212 | 35 | * | ||
213 | 36 | */ | ||
214 | 37 | |||
215 | 38 | #pragma once | ||
216 | 39 | |||
217 | 40 | drizzle_return_t drizzle_state_binlog_read(drizzle_st *con); | ||
218 | 41 | |||
219 | 0 | 42 | ||
220 | === added file 'libdrizzle/column.h' | |||
221 | --- libdrizzle/column.h 1970-01-01 00:00:00 +0000 | |||
222 | +++ libdrizzle/column.h 2012-12-31 00:24:23 +0000 | |||
223 | @@ -0,0 +1,49 @@ | |||
224 | 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
225 | 2 | * | ||
226 | 3 | * Drizzle Client & Protocol Library | ||
227 | 4 | * | ||
228 | 5 | * Copyright (C) 2012 Drizzle Developer Group | ||
229 | 6 | * All rights reserved. | ||
230 | 7 | * | ||
231 | 8 | * Redistribution and use in source and binary forms, with or without | ||
232 | 9 | * modification, are permitted provided that the following conditions are | ||
233 | 10 | * met: | ||
234 | 11 | * | ||
235 | 12 | * * Redistributions of source code must retain the above copyright | ||
236 | 13 | * notice, this list of conditions and the following disclaimer. | ||
237 | 14 | * | ||
238 | 15 | * * Redistributions in binary form must reproduce the above | ||
239 | 16 | * copyright notice, this list of conditions and the following disclaimer | ||
240 | 17 | * in the documentation and/or other materials provided with the | ||
241 | 18 | * distribution. | ||
242 | 19 | * | ||
243 | 20 | * * The names of its contributors may not be used to endorse or | ||
244 | 21 | * promote products derived from this software without specific prior | ||
245 | 22 | * written permission. | ||
246 | 23 | * | ||
247 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
248 | 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
249 | 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
250 | 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
251 | 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
252 | 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
253 | 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
254 | 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
255 | 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
256 | 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
257 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
258 | 35 | * | ||
259 | 36 | */ | ||
260 | 37 | |||
261 | 38 | #pragma once | ||
262 | 39 | |||
263 | 40 | /** | ||
264 | 41 | * Initialize a column structure. | ||
265 | 42 | */ | ||
266 | 43 | drizzle_column_st *drizzle_column_create(drizzle_result_st *result); | ||
267 | 44 | |||
268 | 45 | void drizzle_column_set_default_value(drizzle_column_st *column, | ||
269 | 46 | const uint8_t *default_value, | ||
270 | 47 | size_t size); | ||
271 | 48 | |||
272 | 49 | |||
273 | 0 | 50 | ||
274 | === modified file 'libdrizzle/common.h' | |||
275 | --- libdrizzle/common.h 2012-12-30 02:23:50 +0000 | |||
276 | +++ libdrizzle/common.h 2012-12-31 00:24:23 +0000 | |||
277 | @@ -68,5 +68,7 @@ | |||
278 | 68 | #include "libdrizzle/pack.h" | 68 | #include "libdrizzle/pack.h" |
279 | 69 | #include "libdrizzle/state.h" | 69 | #include "libdrizzle/state.h" |
280 | 70 | #include "libdrizzle/sha1.h" | 70 | #include "libdrizzle/sha1.h" |
281 | 71 | #include "libdrizzle/column.h" | ||
282 | 72 | #include "libdrizzle/binlog.h" | ||
283 | 71 | 73 | ||
284 | 72 | #include <memory.h> | 74 | #include <memory.h> |
285 | 73 | 75 | ||
286 | === modified file 'libdrizzle/conn.cc' | |||
287 | --- libdrizzle/conn.cc 2012-12-30 02:23:50 +0000 | |||
288 | +++ libdrizzle/conn.cc 2012-12-31 00:24:23 +0000 | |||
289 | @@ -799,8 +799,6 @@ | |||
290 | 799 | drizzle_return_t drizzle_state_addrinfo(drizzle_st *con) | 799 | drizzle_return_t drizzle_state_addrinfo(drizzle_st *con) |
291 | 800 | { | 800 | { |
292 | 801 | drizzle_tcp_st *tcp; | 801 | drizzle_tcp_st *tcp; |
293 | 802 | const char *host; | ||
294 | 803 | char port[NI_MAXSERV]; | ||
295 | 804 | struct addrinfo ai; | 802 | struct addrinfo ai; |
296 | 805 | 803 | ||
297 | 806 | if (con == NULL) | 804 | if (con == NULL) |
298 | @@ -822,6 +820,7 @@ | |||
299 | 822 | tcp->addrinfo= NULL; | 820 | tcp->addrinfo= NULL; |
300 | 823 | } | 821 | } |
301 | 824 | 822 | ||
302 | 823 | char port[NI_MAXSERV]; | ||
303 | 825 | if (tcp->port != 0) | 824 | if (tcp->port != 0) |
304 | 826 | { | 825 | { |
305 | 827 | snprintf(port, NI_MAXSERV, "%u", tcp->port); | 826 | snprintf(port, NI_MAXSERV, "%u", tcp->port); |
306 | @@ -837,6 +836,7 @@ | |||
307 | 837 | ai.ai_protocol= IPPROTO_TCP; | 836 | ai.ai_protocol= IPPROTO_TCP; |
308 | 838 | ai.ai_family= AF_UNSPEC; | 837 | ai.ai_family= AF_UNSPEC; |
309 | 839 | 838 | ||
310 | 839 | const char *host; | ||
311 | 840 | if (tcp->host == NULL) | 840 | if (tcp->host == NULL) |
312 | 841 | { | 841 | { |
313 | 842 | host= DRIZZLE_DEFAULT_TCP_HOST; | 842 | host= DRIZZLE_DEFAULT_TCP_HOST; |
314 | 843 | 843 | ||
315 | === modified file 'libdrizzle/conn_local.h' | |||
316 | --- libdrizzle/conn_local.h 2012-12-29 21:44:53 +0000 | |||
317 | +++ libdrizzle/conn_local.h 2012-12-31 00:24:23 +0000 | |||
318 | @@ -2,6 +2,7 @@ | |||
319 | 2 | * | 2 | * |
320 | 3 | * Drizzle Client & Protocol Library | 3 | * Drizzle Client & Protocol Library |
321 | 4 | * | 4 | * |
322 | 5 | * Copyright (C) 2012 Drizzle Developer Group | ||
323 | 5 | * Copyright (C) 2008 Eric Day (eday@oddments.org) | 6 | * Copyright (C) 2008 Eric Day (eday@oddments.org) |
324 | 6 | * All rights reserved. | 7 | * All rights reserved. |
325 | 7 | * | 8 | * |
326 | @@ -58,7 +59,6 @@ | |||
327 | 58 | * @param[in] con Connection structure previously initialized with | 59 | * @param[in] con Connection structure previously initialized with |
328 | 59 | * drizzle_create(), drizzle_clone(), or related functions. | 60 | * drizzle_create(), drizzle_clone(), or related functions. |
329 | 60 | */ | 61 | */ |
330 | 61 | DRIZZLE_LOCAL | ||
331 | 62 | void drizzle_reset_addrinfo(drizzle_st *con); | 62 | void drizzle_reset_addrinfo(drizzle_st *con); |
332 | 63 | 63 | ||
333 | 64 | /** | 64 | /** |
334 | @@ -75,13 +75,49 @@ | |||
335 | 75 | * @return On success, a pointer to the (possibly allocated) structure. On | 75 | * @return On success, a pointer to the (possibly allocated) structure. On |
336 | 76 | * failure this will be NULL. | 76 | * failure this will be NULL. |
337 | 77 | */ | 77 | */ |
338 | 78 | DRIZZLE_LOCAL | ||
339 | 79 | drizzle_result_st *drizzle_command_write(drizzle_st *con, | 78 | drizzle_result_st *drizzle_command_write(drizzle_st *con, |
340 | 80 | drizzle_result_st *result, | 79 | drizzle_result_st *result, |
341 | 81 | drizzle_command_t command, | 80 | drizzle_command_t command, |
342 | 82 | const void *data, size_t size, | 81 | const void *data, size_t size, |
343 | 83 | size_t total, | 82 | size_t total, |
344 | 84 | drizzle_return_t *ret_ptr); | 83 | drizzle_return_t *ret_ptr); |
345 | 84 | /** | ||
346 | 85 | * Set TCP host and port for a connection. | ||
347 | 86 | * | ||
348 | 87 | * @param[in] con Connection structure previously initialized with | ||
349 | 88 | * drizzle_create(), drizzle_clone(), or related functions. | ||
350 | 89 | * @param[in] host Host to use for this connection, NULL for default value. | ||
351 | 90 | * @param[in] port Port to use for this connection, 0 for default value. | ||
352 | 91 | */ | ||
353 | 92 | void drizzle_set_tcp(drizzle_st *con, const char *host, in_port_t port); | ||
354 | 93 | |||
355 | 94 | /** | ||
356 | 95 | * Get unix domain socket for a connection. | ||
357 | 96 | * | ||
358 | 97 | * @param[in] con Connection structure previously initialized with | ||
359 | 98 | * drizzle_create(), drizzle_clone(), or related functions. | ||
360 | 99 | * @return Unix domain socket set for this connection, NULL if not set. | ||
361 | 100 | */ | ||
362 | 101 | const char *drizzle_uds(const drizzle_st *con); | ||
363 | 102 | |||
364 | 103 | /** | ||
365 | 104 | * Set username and password for a connection. | ||
366 | 105 | * | ||
367 | 106 | * @param[in] con Connection structure previously initialized with | ||
368 | 107 | * drizzle_create(), drizzle_clone(), or related functions. | ||
369 | 108 | * @param[in] user Username to use for this connection. | ||
370 | 109 | * @param[in] password Password to use for this connection. | ||
371 | 110 | */ | ||
372 | 111 | void drizzle_set_auth(drizzle_st *con, const char *user, const char *password); | ||
373 | 112 | |||
374 | 113 | /** | ||
375 | 114 | * Set database for a connection. | ||
376 | 115 | * | ||
377 | 116 | * @param[in] con Connection structure previously initialized with | ||
378 | 117 | * drizzle_create(), drizzle_clone(), or related functions. | ||
379 | 118 | * @param[in] db Database to use with this connection. | ||
380 | 119 | */ | ||
381 | 120 | void drizzle_set_db(drizzle_st *con, const char *db); | ||
382 | 85 | 121 | ||
383 | 86 | /** | 122 | /** |
384 | 87 | * Check if state stack is empty. | 123 | * Check if state stack is empty. |
385 | 88 | 124 | ||
386 | === modified file 'libdrizzle/drizzle_local.h' | |||
387 | --- libdrizzle/drizzle_local.h 2012-12-22 08:54:15 +0000 | |||
388 | +++ libdrizzle/drizzle_local.h 2012-12-31 00:24:23 +0000 | |||
389 | @@ -58,11 +58,32 @@ | |||
390 | 58 | * @param[in] function Name of function the error happened in. | 58 | * @param[in] function Name of function the error happened in. |
391 | 59 | * @param[in] format Format and variable argument list of message. | 59 | * @param[in] format Format and variable argument list of message. |
392 | 60 | */ | 60 | */ |
393 | 61 | DRIZZLE_LOCAL | ||
394 | 62 | void drizzle_set_error(drizzle_st *con, const char *function, | 61 | void drizzle_set_error(drizzle_st *con, const char *function, |
395 | 63 | const char *format, ...); | 62 | const char *format, ...); |
396 | 64 | 63 | ||
397 | 65 | /** | 64 | /** |
398 | 65 | * Initialize a connection structure. Always check the return value even if | ||
399 | 66 | * passing in a pre-allocated structure. Some other initialization may have | ||
400 | 67 | * failed. | ||
401 | 68 | * | ||
402 | 69 | * @param[in] drizzle Drizzle structure previously initialized with | ||
403 | 70 | * drizzle_create() or drizzle_clone(). | ||
404 | 71 | * @param[in] con Caller allocated structure, or NULL to allocate one. | ||
405 | 72 | * @return On success, a pointer to the (possibly allocated) structure. On | ||
406 | 73 | * failure this will be NULL. | ||
407 | 74 | */ | ||
408 | 75 | drizzle_st *drizzle_create(void); | ||
409 | 76 | |||
410 | 77 | /** | ||
411 | 78 | * Free a connection structure. | ||
412 | 79 | * | ||
413 | 80 | * @param[in] con Connection structure previously initialized with | ||
414 | 81 | * drizzle_create(), drizzle_clone(), or related functions. | ||
415 | 82 | */ | ||
416 | 83 | void drizzle_free(drizzle_st *con); | ||
417 | 84 | |||
418 | 85 | |||
419 | 86 | /** | ||
420 | 66 | * Log a message. | 87 | * Log a message. |
421 | 67 | * | 88 | * |
422 | 68 | * @param[in] drizzle Drizzle con structure | 89 | * @param[in] drizzle Drizzle con structure |
423 | @@ -70,15 +91,18 @@ | |||
424 | 70 | * @param[in] format Format and variable argument list of message. | 91 | * @param[in] format Format and variable argument list of message. |
425 | 71 | * @param[in] args Variable argument list that has been initialized. | 92 | * @param[in] args Variable argument list that has been initialized. |
426 | 72 | */ | 93 | */ |
430 | 73 | DRIZZLE_LOCAL | 94 | void drizzle_log(drizzle_st *con, drizzle_verbose_t verbose, const char *format, va_list args); |
431 | 74 | void drizzle_log(drizzle_st *con, drizzle_verbose_t verbose, | 95 | |
432 | 75 | const char *format, va_list args); | 96 | /** |
433 | 97 | * Initialize a result structure. | ||
434 | 98 | */ | ||
435 | 99 | drizzle_result_st *drizzle_result_create(drizzle_st *con); | ||
436 | 100 | |||
437 | 76 | 101 | ||
438 | 77 | /** | 102 | /** |
439 | 78 | * Log a fatal message, see drizzle_log() for argument details. | 103 | * Log a fatal message, see drizzle_log() for argument details. |
440 | 79 | */ | 104 | */ |
443 | 80 | static inline void drizzle_log_fatal(drizzle_st *con, const char *format, | 105 | static inline void drizzle_log_fatal(drizzle_st *con, const char *format, ...) |
442 | 81 | ...) | ||
444 | 82 | { | 106 | { |
445 | 83 | va_list args; | 107 | va_list args; |
446 | 84 | 108 | ||
447 | 85 | 109 | ||
448 | === modified file 'libdrizzle/include.am' | |||
449 | --- libdrizzle/include.am 2012-12-30 02:23:50 +0000 | |||
450 | +++ libdrizzle/include.am 2012-12-31 00:24:23 +0000 | |||
451 | @@ -2,14 +2,16 @@ | |||
452 | 2 | # included from Top Level Makefile.am | 2 | # included from Top Level Makefile.am |
453 | 3 | # All paths should be given relative to the root | 3 | # All paths should be given relative to the root |
454 | 4 | 4 | ||
455 | 5 | noinst_HEADERS+= libdrizzle/binlog.h | ||
456 | 6 | noinst_HEADERS+= libdrizzle/column.h | ||
457 | 5 | noinst_HEADERS+= libdrizzle/common.h | 7 | noinst_HEADERS+= libdrizzle/common.h |
458 | 6 | noinst_HEADERS+= libdrizzle/conn_local.h | 8 | noinst_HEADERS+= libdrizzle/conn_local.h |
459 | 9 | noinst_HEADERS+= libdrizzle/datetime.h | ||
460 | 7 | noinst_HEADERS+= libdrizzle/drizzle_local.h | 10 | noinst_HEADERS+= libdrizzle/drizzle_local.h |
461 | 8 | noinst_HEADERS+= libdrizzle/pack.h | 11 | noinst_HEADERS+= libdrizzle/pack.h |
462 | 9 | noinst_HEADERS+= libdrizzle/sha1.h | 12 | noinst_HEADERS+= libdrizzle/sha1.h |
463 | 10 | noinst_HEADERS+= libdrizzle/state.h | 13 | noinst_HEADERS+= libdrizzle/state.h |
464 | 11 | noinst_HEADERS+= libdrizzle/structs.h | 14 | noinst_HEADERS+= libdrizzle/structs.h |
465 | 12 | noinst_HEADERS+= libdrizzle/datetime.h | ||
466 | 13 | 15 | ||
467 | 14 | lib_LTLIBRARIES+= libdrizzle/libdrizzle.la | 16 | lib_LTLIBRARIES+= libdrizzle/libdrizzle.la |
468 | 15 | libdrizzle_libdrizzle_la_SOURCES= | 17 | libdrizzle_libdrizzle_la_SOURCES= |
469 | 16 | 18 | ||
470 | === modified file 'rpm/spec.in' | |||
471 | --- rpm/spec.in 2012-12-24 10:20:04 +0000 | |||
472 | +++ rpm/spec.in 2012-12-31 00:24:23 +0000 | |||
473 | @@ -74,7 +74,6 @@ | |||
474 | 74 | %{_includedir}/libdrizzle-5.1/field_client.h | 74 | %{_includedir}/libdrizzle-5.1/field_client.h |
475 | 75 | %{_includedir}/libdrizzle-5.1/handshake_client.h | 75 | %{_includedir}/libdrizzle-5.1/handshake_client.h |
476 | 76 | %{_includedir}/libdrizzle-5.1/libdrizzle.h | 76 | %{_includedir}/libdrizzle-5.1/libdrizzle.h |
477 | 77 | %{_includedir}/libdrizzle-5.1/pack.h | ||
478 | 78 | %{_includedir}/libdrizzle-5.1/query.h | 77 | %{_includedir}/libdrizzle-5.1/query.h |
479 | 79 | %{_includedir}/libdrizzle-5.1/result.h | 78 | %{_includedir}/libdrizzle-5.1/result.h |
480 | 80 | %{_includedir}/libdrizzle-5.1/result_client.h | 79 | %{_includedir}/libdrizzle-5.1/result_client.h |
481 | 81 | 80 | ||
482 | === modified file 'tests/unit/binlog.c' | |||
483 | --- tests/unit/binlog.c 2012-12-30 02:23:50 +0000 | |||
484 | +++ tests/unit/binlog.c 2012-12-31 00:24:23 +0000 | |||
485 | @@ -49,7 +49,12 @@ | |||
486 | 49 | (void) argc; | 49 | (void) argc; |
487 | 50 | (void) argv; | 50 | (void) argv; |
488 | 51 | 51 | ||
490 | 52 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 52 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
491 | 53 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
492 | 54 | getenv("MYSQL_USER"), | ||
493 | 55 | getenv("MYSQL_PASSWORD"), | ||
494 | 56 | getenv("MYSQL_SCHEMA"), 0); | ||
495 | 57 | |||
496 | 53 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 58 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
497 | 54 | 59 | ||
498 | 55 | drizzle_return_t ret= drizzle_connect(con); | 60 | drizzle_return_t ret= drizzle_connect(con); |
499 | 56 | 61 | ||
500 | === modified file 'tests/unit/column.c' | |||
501 | --- tests/unit/column.c 2012-12-30 02:23:50 +0000 | |||
502 | +++ tests/unit/column.c 2012-12-31 00:24:23 +0000 | |||
503 | @@ -49,7 +49,11 @@ | |||
504 | 49 | drizzle_row_t row; | 49 | drizzle_row_t row; |
505 | 50 | int num_fields; | 50 | int num_fields; |
506 | 51 | 51 | ||
508 | 52 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 52 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
509 | 53 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
510 | 54 | getenv("MYSQL_USER"), | ||
511 | 55 | getenv("MYSQL_PASSWORD"), | ||
512 | 56 | getenv("MYSQL_SCHEMA"), 0); | ||
513 | 53 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 57 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
514 | 54 | 58 | ||
515 | 55 | drizzle_return_t ret= drizzle_connect(con); | 59 | drizzle_return_t ret= drizzle_connect(con); |
516 | 56 | 60 | ||
517 | === modified file 'tests/unit/connect.c' | |||
518 | --- tests/unit/connect.c 2012-12-30 02:23:50 +0000 | |||
519 | +++ tests/unit/connect.c 2012-12-31 00:24:23 +0000 | |||
520 | @@ -47,7 +47,11 @@ | |||
521 | 47 | (void) argc; | 47 | (void) argc; |
522 | 48 | (void) argv; | 48 | (void) argv; |
523 | 49 | 49 | ||
525 | 50 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 50 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
526 | 51 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
527 | 52 | getenv("MYSQL_USER"), | ||
528 | 53 | getenv("MYSQL_PASSWORD"), | ||
529 | 54 | getenv("MYSQL_SCHEMA"), 0); | ||
530 | 51 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 55 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
531 | 52 | 56 | ||
532 | 53 | drizzle_return_t ret= drizzle_connect(con); | 57 | drizzle_return_t ret= drizzle_connect(con); |
533 | @@ -59,6 +63,25 @@ | |||
534 | 59 | } | 63 | } |
535 | 60 | ASSERT_EQ(DRIZZLE_RETURN_OK, ret); | 64 | ASSERT_EQ(DRIZZLE_RETURN_OK, ret); |
536 | 61 | 65 | ||
537 | 66 | drizzle_query_str(con, "SELECT 1", &ret); | ||
538 | 67 | ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "SELECT 1 (%s)", drizzle_error(con)); | ||
539 | 68 | |||
540 | 69 | // Now that we know everything is good... lets push it. | ||
541 | 70 | drizzle_close(con); | ||
542 | 71 | |||
543 | 72 | int limit= 20; | ||
544 | 73 | while (--limit) | ||
545 | 74 | { | ||
546 | 75 | ret= drizzle_connect(con); | ||
547 | 76 | ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s(%s)", drizzle_error(con), drizzle_strerror(ret)); | ||
548 | 77 | |||
549 | 78 | drizzle_query_str(con, "SELECT 1", &ret); | ||
550 | 79 | ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "SELECT 1 (%s)", drizzle_error(con)); | ||
551 | 80 | |||
552 | 81 | // Now that we know everything is good... lets push it. | ||
553 | 82 | drizzle_close(con); | ||
554 | 83 | } | ||
555 | 84 | |||
556 | 62 | ret= drizzle_quit(con); | 85 | ret= drizzle_quit(con); |
557 | 63 | ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret)); | 86 | ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s", drizzle_strerror(ret)); |
558 | 64 | 87 | ||
559 | 65 | 88 | ||
560 | === modified file 'tests/unit/insert_id.c' | |||
561 | --- tests/unit/insert_id.c 2012-12-30 02:23:50 +0000 | |||
562 | +++ tests/unit/insert_id.c 2012-12-31 00:24:23 +0000 | |||
563 | @@ -48,7 +48,11 @@ | |||
564 | 48 | (void) argc; | 48 | (void) argc; |
565 | 49 | (void) argv; | 49 | (void) argv; |
566 | 50 | 50 | ||
568 | 51 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 51 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
569 | 52 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
570 | 53 | getenv("MYSQL_USER"), | ||
571 | 54 | getenv("MYSQL_PASSWORD"), | ||
572 | 55 | getenv("MYSQL_SCHEMA"), 0); | ||
573 | 52 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 56 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
574 | 53 | 57 | ||
575 | 54 | drizzle_return_t ret= drizzle_connect(con); | 58 | drizzle_return_t ret= drizzle_connect(con); |
576 | 55 | 59 | ||
577 | === modified file 'tests/unit/query.c' | |||
578 | --- tests/unit/query.c 2012-12-30 02:23:50 +0000 | |||
579 | +++ tests/unit/query.c 2012-12-31 00:24:23 +0000 | |||
580 | @@ -49,7 +49,11 @@ | |||
581 | 49 | drizzle_row_t row; | 49 | drizzle_row_t row; |
582 | 50 | int num_fields; | 50 | int num_fields; |
583 | 51 | 51 | ||
585 | 52 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 52 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
586 | 53 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
587 | 54 | getenv("MYSQL_USER"), | ||
588 | 55 | getenv("MYSQL_PASSWORD"), | ||
589 | 56 | getenv("MYSQL_SCHEMA"), 0); | ||
590 | 53 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 57 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
591 | 54 | 58 | ||
592 | 55 | drizzle_return_t ret= drizzle_connect(con); | 59 | drizzle_return_t ret= drizzle_connect(con); |
593 | 56 | 60 | ||
594 | === modified file 'tests/unit/row.c' | |||
595 | --- tests/unit/row.c 2012-12-30 02:23:50 +0000 | |||
596 | +++ tests/unit/row.c 2012-12-31 00:24:23 +0000 | |||
597 | @@ -49,7 +49,11 @@ | |||
598 | 49 | drizzle_row_t row; | 49 | drizzle_row_t row; |
599 | 50 | int num_fields; | 50 | int num_fields; |
600 | 51 | 51 | ||
602 | 52 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 52 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
603 | 53 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
604 | 54 | getenv("MYSQL_USER"), | ||
605 | 55 | getenv("MYSQL_PASSWORD"), | ||
606 | 56 | getenv("MYSQL_SCHEMA"), 0); | ||
607 | 53 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 57 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
608 | 54 | 58 | ||
609 | 55 | drizzle_return_t ret= drizzle_connect(con); | 59 | drizzle_return_t ret= drizzle_connect(con); |
610 | 56 | 60 | ||
611 | === modified file 'tests/unit/statement.c' | |||
612 | --- tests/unit/statement.c 2012-12-30 02:23:50 +0000 | |||
613 | +++ tests/unit/statement.c 2012-12-31 00:24:23 +0000 | |||
614 | @@ -51,7 +51,11 @@ | |||
615 | 51 | (void) argv; | 51 | (void) argv; |
616 | 52 | drizzle_stmt_st *stmt; | 52 | drizzle_stmt_st *stmt; |
617 | 53 | 53 | ||
619 | 54 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 54 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
620 | 55 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
621 | 56 | getenv("MYSQL_USER"), | ||
622 | 57 | getenv("MYSQL_PASSWORD"), | ||
623 | 58 | getenv("MYSQL_SCHEMA"), 0); | ||
624 | 55 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 59 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
625 | 56 | 60 | ||
626 | 57 | drizzle_return_t ret= drizzle_connect(con); | 61 | drizzle_return_t ret= drizzle_connect(con); |
627 | 58 | 62 | ||
628 | === modified file 'tests/unit/unbuffered_query.c' | |||
629 | --- tests/unit/unbuffered_query.c 2012-12-30 02:23:50 +0000 | |||
630 | +++ tests/unit/unbuffered_query.c 2012-12-31 00:24:23 +0000 | |||
631 | @@ -49,7 +49,11 @@ | |||
632 | 49 | drizzle_row_t row; | 49 | drizzle_row_t row; |
633 | 50 | int num_fields; | 50 | int num_fields; |
634 | 51 | 51 | ||
636 | 52 | drizzle_st *con= drizzle_create_tcp("localhost", DRIZZLE_DEFAULT_TCP_PORT, "root", NULL, NULL, 0); | 52 | drizzle_st *con= drizzle_create_tcp(getenv("MYSQL_SERVER"), |
637 | 53 | getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT, | ||
638 | 54 | getenv("MYSQL_USER"), | ||
639 | 55 | getenv("MYSQL_PASSWORD"), | ||
640 | 56 | getenv("MYSQL_SCHEMA"), 0); | ||
641 | 53 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); | 57 | ASSERT_NOT_NULL_(con, "Drizzle connection object creation error"); |
642 | 54 | 58 | ||
643 | 55 | drizzle_return_t ret= drizzle_connect(con); | 59 | drizzle_return_t ret= drizzle_connect(con); |
https:/ /jenkins. drizzle. org/job/ libdrizzle- build-matrix/ label=fedora- 17/22/console
root with nopass has access denied which is causing test failures