1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00
Commit Graph

115 Commits

Author SHA1 Message Date
Georg Richter
9043f910e9 Merge remote-tracking branch 'origin/3.0' into 3.1 2019-03-09 19:44:07 +01:00
Georg Richter
4ab51e7adf Fix for CONC-301:
This fix got lost by a bad previous merge
2019-03-08 18:38:14 +01:00
Georg Richter
212a9f6519 Fixed prototype for ps callback functions
Connectori/Python callback fixes
2018-12-05 13:40:58 +01:00
Georg Richter
655d902203 CONC-347: Add function mysql_stmt_fetch_field 2018-12-03 13:44:08 +01:00
Georg Richter
e9b3aef20f CONC-348: Add callback support for prepared statements
Client application can now register callback functions for either sending or retrieving data:
- typedef void (*ps_result_callback)(MYSQL_STMT *stmt, unsigned int column, unsigned char **row);
- typedef my_bool *(*ps_param_callback)(MYSQL_STMT *stmt, MYSQL_BIND *bind, unsigned int row_nr);

These functions will be registerd via mysql_stmt_attr_set call by specifying options STMT_ATTR_CB_PARAM
or STMT_ATTR_CB_RESULT.
2018-12-03 13:04:16 +01:00
Georg Richter
639413cb21 Implementation of CONC-349:
Added new parameter STMT_ATTR_STATE to retrieve statement status via api
function mysql_stmt_attr_get
2018-10-23 13:11:23 +02:00
Georg Richter
b0f2e4e72f Coverity fixes and travis integration 2018-07-06 09:28:24 +02:00
Georg Richter
9e1fef0bf2 Fix for CONC-344: reset internal row counter before executing prepared statement 2018-06-28 17:22:08 +02:00
Georg Richter
53c40f5aaa Fix for CONC334:
Copy all members of MYSQL_FIELD from mysql->fields to stmt->fields.
2018-05-29 09:49:35 +02:00
luz.paz
b2e6ed0295 Fixes misc. typos
found via `codespell -q 3`
2018-04-13 07:30:23 +02:00
Georg Richter
748e6fb915 Fix for mariadb_stmt_execute:
If compressed protocol is in use, mariadb_stmt_execute_direct will be emulated by mysql_stmt_prepare and mysql_stmt_execute.
2018-04-12 08:49:26 +02:00
Georg Richter
929614903e Travis and Appveyor integration:
- added travis support
  - fixed appveyor settings
  - fixed some warnings (gcc 4.8)
  - removed sleep commands
  - disabled failing tests when running against MySQL server,
    mostly related to stored procedures and binary protocol
  - reverted fix for MDEV_10361

Still open: TLS/SSL appveyor tests, since .msi installation on appveyor doesn't provide certificates.
2018-02-16 12:14:01 +01:00
Vladislav Vaintroub
935c33b690 Fix Windows size_t warnings. 2018-01-12 18:19:19 +00:00
Georg Richter
e42dd6c0e0 Fix for MDEV-14165:
- The metadata length value for a column with a zerofill flag was calculated with a fixed length instead of using the reported length.
- fixed a possible stackoverflow, if the display width for a column with zerofill flag is greater then 22. (libmysql ps implementation truncates the result after 21 digits and reports truncation error).
2017-10-28 16:46:49 +02:00
Lawrin Novitsky
31f7fb00fc Implementation and testcase for CONC-275 - skipping particular paramset in bulk operation - with help of special indicator value STMT_INDICATOR_IGNORE_ROW set in any column of the row.
The revision also adds some (mainly VS specific) file/dirs definitions to .gitignore to make 'gid status' usable on Windows, and the typo in bulk1 testsuite
2017-10-10 12:23:19 +02:00
Georg Richter
240204eaeb Fix for CONC-282: mysql_stmt_fetch_column doesn't work with prior call to mysql_stmt_store_result
- If no bind variables were bound or the function mysql_stmt_store_result was not called before, the internal bind variables (stmt->bind) was not filled (lengths and null values)
2017-09-25 15:45:14 +02:00
Georg Richter
8b3e6b5dcf Fix for CONC-252:
All functions which are supported by libmysql use now unsigned long as length parameter instead of size_t
2017-07-01 15:42:52 +02:00
Georg Richter
6e156a63e3 Fixes for bigendian systems (CONC-252, CONC-265) 2017-06-30 14:00:28 +02:00
Georg Richter
e50571e3ab Disallow bulk execution if parameter count is 0 2017-05-15 14:11:59 +02:00
Oleksandr Byelkin
d0f9234620 MDEV-12471: BULK Command
After test fixes.
bulk_null() is disabled. Before the client library took care about MYSQL_TYPE_NULL, now it do not do it so server return an error. and I have no idea what should be chenged test or client library.
2017-05-01 15:05:49 +02:00
Georg Richter
08450df078 initial implementation for MDEV-12471 2017-04-24 15:45:58 +02:00
Georg Richter
bde93e828d Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-c 2017-04-03 18:12:13 +02:00
Sergei Golubchik
e9868bfce0 correct mthd_stmt_flush_unbuffered() logic
it needs to read
* if we're reading resultset row packets - till the EOF (254) packet.
* otherwise - till the *second* EOF packet (the first EOF will separate
  resultset metadata packets and resultset row packets)
* or till the OK (0) packet, but not if we're reading resultset row
  packets (because they also start from 0).

Also it needs to update server_status for caller to be able to check the
SERVER_MORE_RESULTS_EXIST flag, and the stmt->state to know that it's
not reading the resultset anymore.

Callers were fixed to invoke mthd_stmt_flush_unbuffered() repeatedly,
when they need to flush all result sets, not just one.

This commit fixes unittest/libmariadb/ps.c unit test
(it was failing to clean up mysql.proc table).
2017-03-30 00:19:41 +02:00
Georg Richter
63e0897d43 Fix for MDEV-12247:
If a statement with open (read only) cursor is executed there is no buffered
result set (result set rows will be fetched directly from server), so we need to skip reading unbuffered result sets if a cursor is open.
2017-03-21 17:26:19 +01:00
Georg Richter
9a865bc88c Fix for CONC-243:
ABI breakage: Revert parameter length from size_t to unsigned long.
  (affects mysql_stmt_prepare, mysql_real_query, mysql_send_query)
2017-03-14 16:11:04 +01:00
Georg Richter
ab3ffdc473 removed api function mysql_get_server_status (introduced in last commit). Instead of mariadb_get_infov now supports additional parameters:
* MARIADB_CONNECTION_SERVER_STATUS
* MARIADB_CONNECTION_SERVER_CAPABILITIES
* MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES
* MARIADB_CONNECTION_CLIENT_CAPABILITIES
2016-12-13 07:09:06 +01:00
Georg Richter
7a1e3a699d - Fixed crash in prepared statement: Indicator variable should be checked only if we are in bulk operation mode (=stmt->array_size > 0 and bulk is supported by server
- Added new api function mysql_get_server_status, so client applications no longer need to access members of the mysql structure
2016-12-10 14:09:53 +01:00
Georg Richter
070fb3026a If a kill statement was prepared and executed we need to check return code
of net_stmt_close in case the connection which belongs to the statement was killed.
2016-12-03 09:21:32 +01:00
Georg Richter
64536703c7 Fix for CONC-218:
To prevent unexpected behavior when reusing a statement with mariadb_stmt_execute_direct
a call to mysql_stmt_attr_set with option STMT_ATTR_PREBIND_PARAMS will reset the statement before.
2016-11-29 13:30:17 +01:00
Georg Richter
c89d5d38e0 Fix for CONC-217: mariadb_stmt_execute_direct: Clear error message from mysql_stmt_execute if mysql_stmt_prepare failed 2016-11-26 13:47:43 +01:00
Georg Richter
8695a17cbc Added support for STMT_INDICATE_IGNORE indicator - please note that the counter part for indicator type ignore is not pushed in server repo yet. 2016-11-26 13:23:57 +01:00
Georg Richter
a11382a8f5 Row wise binding fixes for prepared statements (bulk)
- Fixed offset calculation for length and indicator
- Ignore null values if indicator is STMT_INDICATOR_DEFAULT
2016-11-17 10:47:15 +01:00
Georg Richter
967b2830d8 renamed ma_errmsg.h back to errmsg.h 2016-11-16 18:13:59 +01:00
Georg Richter
3378c0d8b7 Fixed array_binding for MYSQL_TYPE_NULL 2016-11-13 18:37:22 +01:00
Georg Richter
03a7ec1b8b Support mariadb_stmt_execute_direct also for versions < 10.2
Bundled COM_CLOSE and COM_PREPARE packets
2016-11-12 17:51:01 +01:00
Georg Richter
64862325a5 Removed com_multi for mariadb_stmt_execute_direct
added support for pre 10.2-servers in mariadb_stmt_execute_direct
2016-11-10 05:49:11 +01:00
Georg Richter
4d1af73242 Set stmt_id to -1 only for mariadb_stmt_execute_direct 2016-11-04 16:02:08 +01:00
Georg Richter
884ee2262d Smaller fixes for LibreOffice integration:
- added type MYSQL_TYPE_JSON (=245)
  - include error numbers (ma_errmsg.h) via mysql.h
  - convert MYSQL_TYPE_JSON to string (prepared statements)
  - added error message number 2034 (invalid buffer)
2016-10-23 15:53:24 +02:00
Georg Richter
6306c9f46b - removed COM_MULTI from options
COM_MULTI is now available for internal use only, e.g. in
  mariadb_stmt_execute_direct
2016-10-20 08:47:51 +02:00
Vladislav Vaintroub
7cb8479605 Fix Win64 warnings. Correctly define my_socket in ma_global.h 2016-10-12 21:05:31 +00:00
Vladislav Vaintroub
3f2fe93020 Revert "Implement mysql_stmt_execute_direct without COM_MULTI."
This partially reverts commit a06574afab.
2016-09-15 12:14:58 +00:00
Vladislav Vaintroub
8afde21910 Merge branch 'master' of https://github.com/mariadb/mariadb-connector-c 2016-09-09 20:03:16 +00:00
Georg Richter
9f88e25fd6 Compiler warning fixes 2016-09-03 12:46:50 +02:00
Georg Richter
fbf6fd1598 Valgrind fixes:
- fixed 2 unitialized memory errors
- fixed leak in client test
2016-08-21 20:35:13 +02:00
Georg Richter
9207626bb4 10.2-integration
readded api functions
- mysql_debug (dummy)
- mysql_get_parameters
added low level api functions
- mysql_net_field_length
- mysql_net_read
2016-08-18 12:24:32 +02:00
Georg Richter
405bb926e9 Fix for CONC-198: can't use two statements per connection
If we have multiple open cursors we need to check the server_status per statement (not per connection)
2016-08-18 08:04:46 +02:00
Georg Richter
429b166cbe Move mariadb specific client flags and server capabilities to mysql->extension 2016-08-16 14:58:15 +02:00
Georg Richter
8f388ad291 Changed MYSQL_BIND structure (so it will have the same size as in 2.3 and libmysql 2016-08-15 20:52:15 +02:00
Georg Richter
6c0ae00fbb Fix for CONC-197: manual merge form 2.2.3 branch 2016-08-11 15:32:18 +02:00
Georg Richter
7b14603438 Fix for CONC-196: merged manually from connector_c_2.3 branch 2016-08-03 12:30:54 +02:00