summaryrefslogtreecommitdiff
path: root/tests/mysql_client_test.c
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-19838: followup to make happy following protocol implementations:Oleksandr Byelkin2020-11-051-2/+5
| | | | | | | | | | - mysqlnd from PHP < 7.3 - mysql-connector-python any version - mysql-connector-java any version Relaxed check about garbage at the end of the packet in case of no parameters. Added check for array binding. Fixed test according to the new paradigm (allow junk at the end of the packet)
* MDEV-19838 Wrong direxec param data caused crashLawrin Novitsky2020-10-291-0/+149
| | | | | | | | | | | | | | | In case of direct execution(stmtid=-1, mariadb_stmt_execute_direct in C API) application is in control of how many parameters client sends to the server. In case this number is not equal to actual query parameters number, the server may start to interprete packet data incorrectly, e.g. starting from the size of null bitmap. And that could cause it to crash at some point. The commit introduces some additional COM_STMT_EXECUTE packet sanity checks: - checking that "types sent" byte is set, and the value is equal to 1. if it's not direct execution, then that value is 0 or 1. - checking that parameter type value is a valid type, and parameter flags value is 0 or only "unsigned" bit is set - added more checks that read does not go beyond the end of the packet
* Fix GCC 10.2.0 -Og -fsanitize=undefined -Wformat-overflowMarko Mäkelä2020-09-231-3/+4
| | | | | | | | | | | | | | | | | For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON) to the compilation flags will cause even more warnings to be emitted. The warning was a bogus one: tests/mysql_client_test.c:8632:22: error: '%d' directive writing between 1 and 11 bytes into a region of size 9 [-Werror=format-overflow=] 8632 | sprintf(field, "c%d int", i); | ^~ tests/mysql_client_test.c:8632:20: note: directive argument in the range [-2147483648, 999] The warning does not take into account that the lower bound of the variable actually is 0. But, we can help the compiler and use an unsigned variable.
* MDEV-22779: Fix a memory leak in the unit testMarko Mäkelä2020-07-011-0/+2
|
* MDEV-22779: Crash: Prepared Statement with a '?' parameter inside a re-used CTESergei Petrunia2020-06-141-0/+52
| | | | | | | | | | | | | | | | | | | | When a prepared statement parameter '?' is used in a CTE that is used multiple times, the following happens: - The CTE definition is re-parsed multiple times. - There are multiple Item_param objects referring to the same "?" in the original query. - Prepared_statement::param has a pointer to the first of them, the others are "clones". - When prepared statement parameter gets the value, it should be passed over to clones with param->sync_clones() call. This call is made in insert_params(), etc. It was not made in insert_params_with_log(). This would cause Item_param to not have any value which would confuse the query optimizer. Added the missing call.
* Ensure that tests and programs can restore variablesMonty2019-06-031-6/+24
| | | | | | | - --default-character-set can now be disabled in mysqldump - --skip-resolve can be be disabled in mysqld - mysql_client_test now resets global variables it changes - mtr couldn't handle [mysqldump] in config files (wrong regexp used)
* MDEV-19490 show tables fails when selecting the information_schema databaseMonty2019-05-161-0/+21
| | | | | | | The bug was that when using mysql_list_fields, then table_list->schema_table_name was not filled in. Fixed by using table_list->schema_table instead, which is always filled in.
* Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
|\
| * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | MDEV-17036: BULK with replace doesn't take the first parameter in accountOleksandr Byelkin2019-04-251-0/+61
| | | | | | | | | | | | INSERT and REPLACE served by the same function, so flags (and processing) should be the same.
* | | Merge 10.1 into 10.2Marko Mäkelä2019-03-261-1/+1
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2019-03-261-1/+1
| |\ \
| | * | Fix USE_AFTER_FREE (CWE-416)FaramosCZ2019-03-221-1/+1
| | | | | | | | | | | | swap two lines
| * | | MDEV-11966: Impossible to execute prepared ANALYZE SELECTOleksandr Byelkin2019-03-121-0/+20
| | | | | | | | | | | | | | | | Prepare os ANALYZE now respond as EXPLAIN.
| * | | MDEV-14265 - RPMLint warning: shared-lib-calls-exitSergey Vojtovich2018-03-161-11/+2
| | | | | | | | | | | | | | | | Eliminated last exit() call from libmysqld.
* | | | fix memory leaks in mysql_client_testSergei Golubchik2019-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This fixes main.mysql_client_test, main.mysql_client_test_comp, main.mysql_client_test_nonblock failures in ASAN_OPTIONS="abort_on_error=1" runs
* | | | MDEV-16278: Missing DELETE operation in COM_STMT_BULK_STMTOleksandr Byelkin2018-12-141-0/+64
| | | | | | | | | | | | | | | | Allow array binding for DELETE, test it.
* | | | MDEV-14581 Server does not clear diagnostics between sessionsVladislav Vaintroub2018-10-051-0/+15
| | | | | | | | | | | | | | | | | | | | Amend previous patch, so it works in all cases (also for "change user" command, and for RESET CONNECTION in 10.3)
* | | | After-merge fix for commit 98eb9518db1da854048b09d94244a982a1d32f9aMarko Mäkelä2018-03-161-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge only covered 10.1 up to commit 4d248974e00eb915a2fc433cc6b2fb5146281594. Actually merge the changes up to commit 0a534348c75cf435d2017959855de2efa798fd0b. Also, remove the unused InnoDB field trx_t::abort_type.
* | | | MDEV-15289 Binding an out-of-range DATETIME value in binary protocol breaks ↵Alexander Barkov2018-02-161-0/+114
| | | | | | | | | | | | | | | | replication
* | | | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-3/+3
| | | |
* | | | MDEV-12579: Incorrect arguments to mysqld_stmt_execute when using LOBsOleksandr Byelkin2017-06-221-0/+35
| | | | | | | | | | | | | | | | Parameters can be MYSQL_TYPE_VARCHAR for long data load.
* | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-231-0/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.0 into 10.1Marko Mäkelä2017-05-231-0/+1
| |\ \ \ | | |/ /
| | * | MDEV-6262 analyze the coverity report on mariadbSergei Golubchik2017-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-2/+48
|\ \ \ \ | |/ / /
| * | | Merge 10.0 into 10.1Marko Mäkelä2017-03-091-2/+48
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, implement MDEV-11027 a little differently from 5.5 and 10.0: recv_apply_hashed_log_recs(): Change the return type back to void (DB_SUCCESS was always returned). Report progress also via systemd using sd_notifyf().
| | * | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2017-03-031-2/+48
| | |\ \ | | | |/
| | | * MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_listSergei Golubchik2017-02-271-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql_prune_stmt_list() was walking the list following element->next pointers, but inside the loop it was invoking list_add(element) that modified element->next. So, mysql_prune_stmt_list() failed to visit and reset all elements, and some of them were left with pointers to invalid MYSQL.
| * | | MDEV-11082 mysql_client_test: test_ps_query_cache fails with ↵Elena Stepanova2016-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | group-concat-max-len=1M test_bug14169 was setting session group_concat_max_len=1024 and did not clean it up. Because of that test_ps_query_cache, when run with group-concat-max-len != 1024, had different values in connections, and was inserting into query cache when a hit was expected. Fixed by adding a clean-up for the value in test_bug14169
* | | | fix test for windows 64Oleksandr Byelkin2017-03-101-5/+13
| | | |
* | | | MDEV-11966: Impossible to execute prepared ANALYZE SELECTOleksandr Byelkin2017-03-091-0/+20
| | | | | | | | | | | | | | | | Prepare os ANALYZE now respond as EXPLAIN.
* | | | MDEV-11082: Fix mysql_client_test.c (by Elena)Nirbhay Choubey2016-12-191-0/+3
| | | |
* | | | store/show vcols as item->print()Sergei Golubchik2016-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | otherwise we'd need to store sql_mode *per vcol* (consider CREATE INDEX...) and how SHOW CREATE TABLE would support that? Additionally, get rid of vcol::expr_str, just to make sure the string is always generated and never leaked in the original form.
* | | | MDEV-7145: Delayed replicationKristian Nielsen2016-10-161-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge feature into 10.2 from feature branch. Delayed replication adds an option CHANGE MASTER TO master_delay=<seconds> Replication will then delay applying events with that many seconds. This creates a replication slave that reflects the state of the master some time in the past. Feature is ported from MySQL source tree. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
| * | | | MDEV-7145: Delayed replication, fixing test failures.Kristian Nielsen2016-10-141-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Two merge error fixed, and testsuite updated to removed some other test failues. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
* | | | Merge branch '10.2' into bb-10.2-connector-c-integ-submSergei Golubchik2016-09-211-1/+2
|\ \ \ \
| * \ \ \ Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-1/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-1/+2
| | |\ \ \ | | | |/ /
| | | * | MDEV-10559: main.mysql_client_test_nonblock crashes in buildbot on 10.0Oleksandr Byelkin2016-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | fix for async operations
| | | * | MDEV-10559: main.mysql_client_test_nonblock crashes in buildbot on 10.0Oleksandr Byelkin2016-08-151-4/+5
| | | | | | | | | | | | | | | | | | | | Fix tests which possibly fail connects in non_blocking mode.
* | | | | After-review changesSergei Golubchik2016-09-121-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove redundant code * fix tests * move declarations and defines where they belong
* | | | | MDEV-9293 - Use MariaDB's Connector/C in serverVladislav Vaintroub2016-08-251-22/+37
|/ / / /
* | | | Revert "MDEV-9293 Connector/C integration"Vladislav Vaintroub2016-08-191-37/+22
| | | | | | | | | | | | | | | | This reverts commit 7b89b9f5108c80f4f270da922d7e6c182a663719.
* | | | MDEV-9293 Connector/C integrationVladislav Vaintroub2016-08-191-22/+37
| | | |
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-7/+9
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2016-05-041-7/+9
| |\ \ \ | | |/ /
| | * | tests -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ciSergei Golubchik2016-04-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes: MDEV-7693 MariaDB - mysql-test - SUITE:funcs_1 - funcs_1.is_tables_mysql is failing on TABLE_COLLATION /DATABASE_COLLATION MDEV-8487 mysql-test - main.information_schema 'xtradb' fails MDEV-8486 mysql-test - main.bootstrap fails
* | | | Cleanups:Monty2016-04-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed some QQ markers - Removed some rows not compatible with valgrind 3.9.0 - Made mysql_install_db.sh more silent by default. --verbose now gives more information - Added assert that auto-increment doesn't generate 0 (safety) - Removed thd->set_time() in some places as it's set in init_for_queries() - Fixed some --big tests in tokudb - Fixed a bug in mysql_client_test.cc where sql_mode was not properly reset