Merge lp:~linuxjedi/libdrizzle/5.1-docs into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 79
Merged at revision: 79
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-docs
Merge into: lp:libdrizzle
Diff against target: 327 lines (+175/-57)
5 files modified
configure.ac (+2/-2)
docs/api/connection.rst (+7/-0)
docs/api/statement.rst (+157/-43)
docs/examples/statement.rst (+8/-10)
rpm/spec.in (+1/-2)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-docs
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+141978@code.launchpad.net

Description of the change

Update the docs for the latest prep statement changes

Also bump version ready for release soon

To post a comment you must log in.
lp:~linuxjedi/libdrizzle/5.1-docs updated
80. By Andrew Hutchings

Fix spec.in for lib version

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2012-12-29 17:31:57 +0000
+++ configure.ac 2013-01-04 21:00:30 +0000
@@ -6,7 +6,7 @@
6# Use and distribution licensed under the BSD license. See6# Use and distribution licensed under the BSD license. See
7# the COPYING file in this directory for full text.7# the COPYING file in this directory for full text.
88
9AC_INIT([libdrizzle],[5.1.0],[http://bugs.launchpad.net/drizzle],[libdrizzle],[http://drizzle.org/])9AC_INIT([libdrizzle],[5.1.1],[http://bugs.launchpad.net/drizzle],[libdrizzle],[http://drizzle.org/])
1010
11AC_CONFIG_AUX_DIR([build-aux])11AC_CONFIG_AUX_DIR([build-aux])
1212
@@ -27,7 +27,7 @@
27AC_CONFIG_SRCDIR([libdrizzle/drizzle.cc])27AC_CONFIG_SRCDIR([libdrizzle/drizzle.cc])
2828
29#shared library versioning29#shared library versioning
30LIBDRIZZLE_LIBRARY_VERSION=5:1:030LIBDRIZZLE_LIBRARY_VERSION=6:0:0
31# | | |31# | | |
32# +------+ | +---+32# +------+ | +---+
33# | | |33# | | |
3434
=== modified file 'docs/api/connection.rst'
--- docs/api/connection.rst 2012-12-22 08:54:15 +0000
+++ docs/api/connection.rst 2013-01-04 21:00:30 +0000
@@ -215,6 +215,13 @@
215 :param con: A connection object215 :param con: A connection object
216 :returns: A :c:type:`drizzle_return_t` status. :py:const:`DRIZZLE_RETURN_OK` upon success216 :returns: A :c:type:`drizzle_return_t` status. :py:const:`DRIZZLE_RETURN_OK` upon success
217217
218.. c:function:: drizzle_return_t drizzle_close(drizzle_st *con)
219
220 Gracefully disconnect from a server (leaves the connection object available for a reconnect
221
222 :param con: A connection object
223 :returns: A :c:type:`drizzle_return_t` response for the quit command sent to the server
224
218.. c:function:: drizzle_return_t drizzle_quit(drizzle_st *con)225.. c:function:: drizzle_return_t drizzle_quit(drizzle_st *con)
219226
220 Gracefully disconnect from a server and free the connection object227 Gracefully disconnect from a server and free the connection object
221228
=== modified file 'docs/api/statement.rst'
--- docs/api/statement.rst 2012-12-23 14:44:44 +0000
+++ docs/api/statement.rst 2013-01-04 21:00:30 +0000
@@ -19,17 +19,108 @@
19 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into19 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
20 :returns: A newly allocated and prepared statement object (or NULL on error)20 :returns: A newly allocated and prepared statement object (or NULL on error)
2121
22.. c:function:: drizzle_return_t drizzle_stmt_bind_param(drizzle_stmt_st *stmt, uint16_t param_num, drizzle_column_type_t type, void *data, uint32_t length, drizzle_bind_options_t options)22.. c:function:: drizzle_return_t drizzle_stmt_set_tiny(drizzle_stmt_st *stmt, uint16_t param_num, uint8_t value, bool is_unsigned)
2323
24 Bind a parameter to send in statement. This needs to be called before every24 Sets a parameter of a prepared statement to a tinyint value
25 :c:func:`drizzle_stmt_execute` if the data changes.25
2626 :param stmt: A prepared statement object
27 :param stmt: The prepared statement object27 :param param_num: The parameter number to set (starting at 0)
28 :param param_num: The parameter number this bind is for28 :param value: The value to set the parameter
29 :param type: The column type this parameter uses29 :param is_unsigned: Set to true if the parameter is unsigned
30 :param data: The data for this parameter30 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
31 :param length: The length of the data31
32 :param options: Options for the parameter32.. c:function:: drizzle_return_t drizzle_stmt_set_short(drizzle_stmt_st *stmt, uint16_t param_num, uint16_t value, bool is_unsigned)
33
34 Sets a parameter of a prepared statement to a short int value
35
36 :param stmt: A prepared statement object
37 :param param_num: The parameter number to set (starting at 0)
38 :param value: The value to set the parameter
39 :param is_unsigned: Set to true if the parameter is unsigned
40 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
41
42.. c:function:: drizzle_return_t drizzle_stmt_set_int(drizzle_stmt_st *stmt, uint16_t param_num, uint32_t value, bool is_unsigned)
43
44 Sets a parameter of a prepared statement to an int value
45
46 :param stmt: A prepared statement object
47 :param param_num: The parameter number to set (starting at 0)
48 :param value: The value to set the parameter
49 :param is_unsigned: Set to true if the parameter is unsigned
50 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
51
52.. c:function:: drizzle_return_t drizzle_stmt_set_bigint(drizzle_stmt_st *stmt, uint16_t param_num, uint64_t value, bool is_unsigned)
53
54 Sets a parameter of a prepared statement to a bigint value
55
56 :param stmt: A prepared statement object
57 :param param_num: The parameter number to set (starting at 0)
58 :param value: The value to set the parameter
59 :param is_unsigned: Set to true if the parameter is unsigned
60 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
61
62.. c:function:: drizzle_return_t drizzle_stmt_set_double(drizzle_stmt_st *stmt, uint16_t param_num, double value)
63
64 Sets a parameter of a prepared statement to a double value
65
66 :param stmt: A prepared statement object
67 :param param_num: The parameter number to set (starting at 0)
68 :param value: The value to set the parameter
69 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
70
71.. c:function:: drizzle_return_t drizzle_stmt_set_float(drizzle_stmt_st *stmt, uint16_t param_num, float value)
72
73 Sets a parameter of a prepared statement to a float value
74
75 :param stmt: A prepared statement object
76 :param param_num: The parameter number to set (starting at 0)
77 :param value: The value to set the parameter
78 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
79
80.. c:function:: drizzle_return_t drizzle_stmt_set_string(drizzle_stmt_st *stmt, uint16_t param_num, char *value, size_t length)
81
82 Sets a parameter of a prepared statement to a string value
83
84 :param stmt: A prepared statement object
85 :param param_num: The parameter number to set (starting at 0)
86 :param value: The value to set the parameter
87 :param length: The length of the value data
88 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
89
90.. c:function:: drizzle_return_t drizzle_stmt_set_null(drizzle_stmt_st *stmt, uint16_t param_num)
91
92 Sets a parameter of a prepared statement to a NULL value
93
94 :param stmt: A prepared statement object
95 :param param_num: The parameter number to set (starting at 0)
96 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
97
98.. c:function:: drizzle_return_t drizzle_stmt_set_time(drizzle_stmt_st *stmt, uint16_t param_num, uint32_t days, uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t microseconds, bool is_negative)
99
100 Sets a parameter of a prepared statement to a time value
101
102 :param stmt: A prepared statement object
103 :param param_num: The parameter number to set (starting at 0)
104 :param days: The number of days for the time
105 :param hours: The number of hours for the time
106 :param minutes: The number of minutes for the time
107 :param seconds: The number of seconds for the time
108 :param microseconds: The number of microseconds for the time
109 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
110
111.. c:function:: drizzle_return_t drizzle_stmt_set_timestamp(drizzle_stmt_st *stmt, uint16_t param_num, uint16_t year, uint8_t month, uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t microseconds)
112
113 Sets a parameter of a prepared statement to a datetime/timestamp value
114
115 :param stmt: A prepared statement object
116 :param param_num: The parameter number to set (starting at 0)
117 :param year: The year number for the timestamp
118 :param month: The month number for the timestamp
119 :param day: The day number for the timestamp
120 :param hours: The hour number for the timestamp
121 :param minutes: The minute number for the timestamp
122 :param seconds: The minute number for the timestamp
123 :param microseconds: The minute number for the timestamp
33 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success124 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
34125
35.. c:function:: drizzle_return_t drizzle_stmt_execute(drizzle_stmt_st *stmt)126.. c:function:: drizzle_return_t drizzle_stmt_execute(drizzle_stmt_st *stmt)
@@ -71,6 +162,61 @@
71 :param stmt: The prepared statement object162 :param stmt: The prepared statement object
72 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success163 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
73164
165.. c:function:: bool drizzle_stmt_get_is_null(drizzle_stmt_st *stmt, uint16_t column_number, drizzle_return_t *ret_ptr)
166
167 Check if a column for a fetched row is set to NULL
168
169 :param stmt: The prepared statement object
170 :param column_number: The column number to get (starting at 0)
171 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
172 :returns: True if NULL
173
174.. c:function:: bool drizzle_stmt_get_is_unsigned(drizzle_stmt_st *stmt, uint16_t column_number, drizzle_return_t *ret_ptr)
175
176 Check if a column for a fetched row is unsigned
177
178 :param stmt: The prepared statement object
179 :param column_number: The column number to get (starting at 0)
180 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
181 :returns: True if unsigned
182
183.. c:function:: const char *drizzle_stmt_get_string(drizzle_stmt_st *stmt, uint16_t column_number, size_t *len, drizzle_return_t *ret_ptr)
184
185 Get the string value for a column of a fetched row (int types are automatically converted)
186
187 :param stmt: The prepared statement object
188 :param column_number: The column number to get (starting at 0)
189 :param len: A pointer to a :c:type:`size_t` to store the result length into
190 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
191 :returns: A pointer to the string value
192
193.. c:function:: uint32_t drizzle_stmt_get_int(drizzle_stmt_st *stmt, uint16_t column_number, drizzle_return_t *ret_ptr)
194
195 Get the int value for a column of a fetched row
196
197 :param stmt: The prepared statement object
198 :param column_number: The column number to get (starting at 0)
199 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into :py:const:`DRIZZLE_RETURN_TRUNCATED` if a truncation has occurred
200 :returns: The int value
201
202.. c:function:: uint64_t drizzle_stmt_get_bigint(drizzle_stmt_st *stmt, uint16_t column_number, drizzle_return_t *ret_ptr)
203
204 Get the bigint value for a column of a fetched row
205
206 :param stmt: The prepared statement object
207 :param column_number: The column number to get (starting at 0)
208 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into :py:const:`DRIZZLE_RETURN_TRUNCATED` if a truncation has occurred
209 :returns: The bigint value
210
211.. c:function:: double drizzle_stmt_get_double(drizzle_stmt_st *stmt, uint16_t column_number, drizzle_return_t *ret_ptr)
212
213 Get the double value for a column of a fetched row
214
215 :param stmt: The prepared statement object
216 :param column_number: The column number to get (starting at 0)
217 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into :py:const:`DRIZZLE_RETURN_TRUNCATED` if a truncation has occurred
218 :returns: The double value
219
74.. c:function:: drizzle_return_t drizzle_stmt_close(drizzle_stmt_st *stmt)220.. c:function:: drizzle_return_t drizzle_stmt_close(drizzle_stmt_st *stmt)
75221
76 Close and free a prepared statement222 Close and free a prepared statement
@@ -78,38 +224,6 @@
78 :param stmt: The prepared statement object224 :param stmt: The prepared statement object
79 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success225 :returns: A return status code, :py:const:`DRIZZLE_RETURN_OK` upon success
80226
81.. c:function:: drizzle_column_type_t drizzle_stmt_item_type(drizzle_stmt_st *stmt, uint16_t column_number)
82
83 Gets the column type of an element from a row retrieved with :c:func:`drizzle_stmt_fetch`
84
85 :param stmt: The prepared statement object
86 :param column_number: The column number for the element
87 :returns: The column type
88
89.. c:function:: void* drizzle_stmt_item_data(drizzle_stmt_st *stmt, uint16_t column_number)
90
91 Gets the data of an element from a row retrieved with :c:func:`drizzle_stmt_fetch`
92
93 :param stmt: The prepared statement object
94 :param column_number: The column number for the element
95 :returns: The data for the element
96
97.. c:function:: uint32_t drizzle_stmt_item_length(drizzle_stmt_st *stmt, uint16_t column_number)
98
99 Gets the length of the data for an element from a row retrieved with :c:func:`drizzle_stmt_fetch`
100
101 :param stmt: The prepared statement object
102 :param column_number: The column number for the element
103 :returns: The length of data for the element
104
105.. c:function:: drizzle_bind_options_t drizzle_stmt_item_options(drizzle_stmt_st *stmt, uint16_t column_number)
106
107 Gets the options set for an element from a row retrieved with :c:func:`drizzle_stmt_fetch`
108
109 :param stmt: The prepared statement object
110 :param column_number: The column number for the element
111 :returns: The options for the element
112
113.. c:function:: uint16_t drizzle_stmt_column_count(drizzle_stmt_st *stmt)227.. c:function:: uint16_t drizzle_stmt_column_count(drizzle_stmt_st *stmt)
114228
115 Gets the column count for a result set which has been executed using :c:func:`drizzle_stmt_execute`229 Gets the column count for a result set which has been executed using :c:func:`drizzle_stmt_execute`
116230
=== modified file 'docs/examples/statement.rst'
--- docs/examples/statement.rst 2012-12-23 14:44:44 +0000
+++ docs/examples/statement.rst 2013-01-04 21:00:30 +0000
@@ -12,8 +12,8 @@
12:c:func:`drizzle_stmt_prepare` and we can get the number of parameters the12:c:func:`drizzle_stmt_prepare` and we can get the number of parameters the
13server is expecting with :c:func:`drizzle_stmt_param_count`. In this example13server is expecting with :c:func:`drizzle_stmt_param_count`. In this example
14we know that there is only one parameter required so we send one INT type14we know that there is only one parameter required so we send one INT type
15parameter using :c:func:`drizzle_stmt_bind_param` stating that this is15parameter using :c:func:`drizzle_stmt_set_int` stating that this is
16parameter 0 and it is 4 bytes long (standard for an INT type).16parameter 0 and a signed value.
1717
18Once the parameters have been provided the statement is executed using18Once the parameters have been provided the statement is executed using
19:c:func:`drizzle_stmt_execute` and the results buffered using19:c:func:`drizzle_stmt_execute` and the results buffered using
@@ -22,11 +22,9 @@
2222
23Finally we get the result data. A call to :c:func:`drizzle_stmt_fetch` gets23Finally we get the result data. A call to :c:func:`drizzle_stmt_fetch` gets
24the next row from either the network or the buffer (the buffer in this case).24the next row from either the network or the buffer (the buffer in this case).
25The data can be retreived using :c:func:`drizzle_stmt_item_data`, a call for25The int data is retreived using :c:func:`drizzle_stmt_get_int`, a call for
26each column in the row (in example the table only has one column).26each column in the row (in example the table only has one column) is made using
2727the ``drizzle_stmt_get_`` functions.
28It is also possible to get the data type and length of data using the other
29``drizzle_stmt_item_`` functions.
3028
31When we are done the statement is closed and cleaned up using29When we are done the statement is closed and cleaned up using
32:c:func:`drizzle_stmt_close`. It can also be reused with30:c:func:`drizzle_stmt_close`. It can also be reused with
@@ -45,7 +43,7 @@
45 printf("Params: %" PRIu16 "\n", drizzle_stmt_param_count(stmt));43 printf("Params: %" PRIu16 "\n", drizzle_stmt_param_count(stmt));
4644
47 uint32_t val= 1;45 uint32_t val= 1;
48 ret = drizzle_stmt_bind_param(stmt, 0, DRIZZLE_COLUMN_TYPE_LONG, &val, 4, DRIZZLE_BIND_OPTION_NONE);46 ret = drizzle_stmt_set_int(stmt, 0, val, false);
4947
50 ret = drizzle_stmt_execute(stmt);48 ret = drizzle_stmt_execute(stmt);
5149
@@ -54,8 +52,8 @@
54 printf("Rows found: %" PRIu64 "\n", drizzle_stmt_row_count(stmt));52 printf("Rows found: %" PRIu64 "\n", drizzle_stmt_row_count(stmt));
55 while (drizzle_stmt_fetch(stmt) != DRIZZLE_RETURN_ROW_END)53 while (drizzle_stmt_fetch(stmt) != DRIZZLE_RETURN_ROW_END)
56 {54 {
57 uint32_t *res_val;55 uint32_t res_val;
58 res_val= (uint32_t*)drizzle_stmt_item_data(stmt, 0);56 res_val= drizzle_stmt_get_int(stmt, 0, &ret);
59 printf("Got value: %" PRIu32 "\n", *res_val);57 printf("Got value: %" PRIu32 "\n", *res_val);
60 }58 }
61 ret = drizzle_stmt_close(stmt);59 ret = drizzle_stmt_close(stmt);
6260
=== modified file 'rpm/spec.in'
--- rpm/spec.in 2012-12-31 00:19:49 +0000
+++ rpm/spec.in 2013-01-04 21:00:30 +0000
@@ -53,8 +53,7 @@
53%{_libdir}/libdrizzle.a53%{_libdir}/libdrizzle.a
54%{_libdir}/libdrizzle.la54%{_libdir}/libdrizzle.la
55%{_libdir}/libdrizzle.so55%{_libdir}/libdrizzle.so
56%{_libdir}/libdrizzle.so.556%{_libdir}/libdrizzle.so.*
57%{_libdir}/libdrizzle.so.5.0.1
58%{_bindir}/drizzle_binlogs57%{_bindir}/drizzle_binlogs
59%{_bindir}/libdrizzle-config58%{_bindir}/libdrizzle-config
6059

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: