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

144 Commits

Author SHA1 Message Date
Marko Mäkelä
f4772150d2 CONC-566 fixup: unit test cleanup 2021-10-05 16:48:07 +03:00
Georg Richter
2933a1ca75 Merge branch '3.1' into 3.2 2021-10-05 15:19:59 +02:00
Georg Richter
9c02505474 Fixed for MDEV-26761:
If mariadb_stmt_execute_direct fails, we need to set the number
of parameters (obtained by response packet of mysql_stmt_prepare)
back to the number of prebinded parameters to avoid memory
overrun.

This fix also includes several adress-sanitizer bugs in unit tests
of Connector/C.
2021-10-05 14:50:32 +02:00
Georg Richter
18f7cf423f Merge branch '3.1' into 3.2 2021-09-25 16:28:04 +02:00
Georg Richter
4b9379b2aa Fix for CONC-566:
If cursor type is set to read only, and SERVER_STATUS_CURSOR_EXISTS
flag was not set in the server_status of EOF packet, the assumption
was made that a single result set will follow which will be stored
by a call to mysql_stmt_store_result().

As the example in the bug report shows, this is not always the case,
since a stored procedure call might also unset the CURSOR flag and
will always return multiple result sets. In this case it will be
handled now as "normal" unbuffered result set.
2021-09-25 16:07:24 +02:00
Georg Richter
9661ddaefb Fixed compiler warnings (introduced by changeset b78ba1b251) 2021-06-24 15:05:08 +02:00
Georg Richter
47df15edb6 Fixed compiler warnings (introduced by changeset b78ba1b251) 2021-06-24 11:27:07 +02:00
kolzeq
25e38080cb Merge branch '3.1' into 3.2-diego
# Conflicts:
#	.travis.yml
#	unittest/libmariadb/charset.c
#	unittest/libmariadb/connection.c
2021-06-17 10:54:30 +02:00
kolzeq
94e85cdd4b testing various correction
travis: use connector-test-machine test script that permit to run the following tests :

* MariaDB all supported version
* Maxscale
* MySQL
* SkySQL

If CONNECTOR_TEST_SECRET_KEY is not provided (PR) only MariaDB and MySQL community will be test
Pull request testing correction

appveyor correction using archive if not latest server release
2021-06-15 17:09:10 +02:00
Vladislav Vaintroub
b6f8883d96 CONC-534 memory leak in ps_bugs.c 2021-03-15 20:07:28 +01:00
Georg Richter
b21c39c001 Merge branch '3.1' into 3.2 2021-03-14 12:03:07 +01:00
Georg Richter
56497646b7 Disable failing tests when running against MaxScale. 2021-03-14 11:53:28 +01:00
Georg Richter
ca1ea5c1a2 Fix for CONC-525: Support LOAD * LOCAL INFILE statements in binary protocol
With implementation of MDEV-16708 (support all commands in binary protocol) we
need to check for local infile in text and binary protocol. Therefore the local
infile relevant part from ma_simple_command was moved to mthd_my_send_cmd method.
2021-02-23 07:55:35 +01:00
Georg Richter
67cd96f141 Revert "CONC-142: Fix memory leak in connection"
This reverts commit 63a207e790.
2021-02-09 20:27:52 +01:00
Georg Richter
63a207e790 CONC-142: Fix memory leak in connection
When closing connection object the reference of server_version_info
needs to be decremented to prevent memory leakage.
2021-02-09 20:25:55 +01:00
Oleksandr Byelkin
e62ff462c5 fix memory leack in the test 2021-01-28 11:20:35 +01:00
Oleksandr Byelkin
e21d21d71f Fix ASAN issues in the tests 2021-01-27 20:25:13 +01:00
Oleksandr Byelkin
b503e52288 fix problems found by 10.0 2021-01-27 13:13:31 +01:00
Anton Golovenko
a7e888b518 Test bugs fixes 2021-01-20 18:54:55 +05:00
kolzeq
29fc3bc7bd [misc] test improvement
* adding SkySQL HA to test suite
* test server build 10.6
* test maxscale 2.5.3
2021-01-19 10:23:14 +01:00
Georg Richter
820faff627 codespell fixes, removed MSDOS preprocessor macros 2020-11-26 09:07:17 +01:00
Georg Richter
88e9d172b4 Added missing test case for CONC-512 2020-11-08 14:52:42 +01:00
Marko Mäkelä
0cdc1656a7 Do not leak memory in the skipped MDEV-23768 unit test 2020-10-24 11:07:47 +03:00
Georg Richter
55a64c1bd5 Fix for CONC-504: reset stmt->result.rows when executing mysql_stmt_next_result
While in text protocol the number of rows is resetted in mysql_store/use_result
in binary protocol we need to explicitly reset it when switching to next result set.
2020-10-02 09:47:52 +02:00
Georg Richter
aa65bd1beb Skip test_returning, since it's not fixed on server yet (MDEV-23768) 2020-09-21 18:25:10 +02:00
Georg Richter
8752eea4f2 Use a newer ubuntu version for travis 2020-09-21 15:44:05 +02:00
Georg Richter
9637689e5e Test and travis modification for testing against SkySQL 2020-09-02 14:08:19 +02:00
Oleksandr Byelkin
895dcb61e3 C preprocessor defines fix 2020-06-04 16:49:21 +02:00
Georg Richter
2d81c70a41 Fix max_param test:
Allocate memory for parameters on heap instead of stack.
2020-04-26 03:07:59 +02:00
Georg Richter
3be5897c33 Fix for MDEV-21920
when converting (or copying) from string empty string weren't handled
correctly. This was a regression error, introduced by a prior covscan fix.
2020-03-12 12:06:40 +01:00
Georg Richter
947357354a Added test for testing maximun number of parmeters in binary protocol. 2019-10-22 17:36:22 +02:00
Oleksandr Byelkin
0c20765baf Fix of memory leack in the test and end spaces. 2019-07-18 13:42:29 +02:00
Georg Richter
d09ac51df3 Workaround/Fix for CONC-424:
1) In case a cursor is used in a stored procedure server sends a SERVER_STATUS_CURSOR_EXISTS flag,
even if the client didn't open a cursor via mysql_stmt_attr_set. This ends in a "comands out of sync" error,
since the client is sending a COM_STMT_FETCH command while the result sets were not read before.
We check now in case server sends a SERVER_STATUS_CURSOR_EXIST flag, if the client opened a cursor before.

2) The stmt error codes weren't update for all COM_STMT* commands correctly, e.g. COM_STMT_FETCH didn't show an error even if it failed.
2019-06-30 12:41:42 +02:00
Oleksandr Byelkin
d4a0a38445 Better test of warnings during prepare. 2019-06-14 08:47:21 +02:00
Georg Richter
0ca2f2cb38 Fixed conversion from zerofill integer to MYSQL_TYPE_STRING:
if the length of the provided result buffer is equal or smaller than the converted number and
ZEROFILL FLAG is set, a truncation error will be reported.
2019-02-06 11:00:42 +01:00
Sergei Golubchik
34f8887af0 Fix warnings on Windows 2018-12-18 17:34:42 +01:00
Vladislav Vaintroub
1ecc37f94f CONC-387 return MYSQL_DATA_TRUNCATED for invalid numeric strings.
Fix a regression in new my_atoll()/my_atoull()
to set error, if there are non-digits found in the string.

Spaces at the start and end of string are ignored (however, not between the
digits).
2018-12-07 17:21:39 +01:00
Vladislav Vaintroub
06fd8c901e CONC-372 Fix str_to_TIME() parsing wrt performance.
Fix implementations of str_to_TIME() and my_atoll()

Implement own version my_strtoll() (similar to strtoull(), not requiring
null termination).

Use it to for optimized implementation of numbers and dates.
2018-11-11 02:24:21 +01:00
Lawrin Novitsky
738e4fa86f Correction of test_codbc138 test. It could fail
with some compilers(observed with VS). That would happen in memcmp of 2 MYSQL_TIME structures. Apparently because different
content of memory areas the compiler used to pad structures.
2018-11-08 15:42:25 +01:00
Sergei Golubchik
6545b1d194 CONC-371 fix for frac > 6 2018-11-07 13:29:43 +01:00
Sergei Golubchik
efc9f60dbf compilation failure on windows
libmariadb\libmariadb\ma_stmt_codec.c(263): warning C4244: '*=': conversion from 'double' to 'unsigned long', possible loss of data

generally avoid slow floating point pow() when all you need is to
multiply an integer by a small power of 10.
2018-11-07 08:48:54 +01:00
Georg Richter
70082afeb7 Fix for CONC-371: Incorrect fractional part conversion
If a datetime or time value is represented a a string and has a fractional part with less than 6 digits,
it should be interpreted as a 6-digit representation:

.9 becomes 900000
.09 becomes 90000
etc.
2018-11-06 10:03:15 +01:00
Georg Richter
dc50976e36 Fix for travis tests:
Older server versions don't support CREATE or REPLACE syntax.
2018-07-03 11:22:31 +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
1511314d3a Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-c 2018-05-29 11:43:47 +02:00
Georg Richter
407ca36f24 Fixed string conversion to MYSQL_TIME_TYPE:
- added support for negative time values
- invalid strings (and/or conversion) and invalid values will result in MYSQL_TIMESTAMP_ERROR time type
- added support for 2digit year representation:
    values < 69 will be converted to 20YY
    values >= 69 will be converted to 19YY
2018-05-29 11:42:36 +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
Georg Richter
3f43953fcb Fixed test case for expired password
Added test case for ODBC-138
2018-04-20 07:19:40 +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