From 8752eea4f27614d7e118f90047303a4d5738cb8b Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 21 Sep 2020 15:44:05 +0200 Subject: [PATCH] Use a newer ubuntu version for travis --- .travis.yml | 1 + unittest/libmariadb/ps_bugs.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.travis.yml b/.travis.yml index 20c83ffd..9bcdf1c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: focal sudo: true language: c cache: diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c index 89f62c74..c829cf3a 100644 --- a/unittest/libmariadb/ps_bugs.c +++ b/unittest/libmariadb/ps_bugs.c @@ -5199,7 +5199,38 @@ static int test_mdev_21920(MYSQL *mysql) return OK; } +static int test_returning(MYSQL *mysql) +{ + MYSQL_STMT *stmt= mysql_stmt_init(mysql); + MYSQL_RES *result; + int rc; + + rc= mysql_query(mysql, "CREATE TEMPORARY TABLE t1 (a int not null auto_increment primary key, b json)"); + check_mysql_rc(rc, mysql); + + rc= mysql_query(mysql, "INSERT INTO t1 (a,b) VALUES (NULL, '[incorrect json]') RETURNING a"); + check_mysql_rc(rc, mysql); + + if (!rc) diag("should have fail"); + + result= mysql_store_result(mysql); + mysql_free_result(result); + + diag("Error: %s", mysql_error(mysql)); + + rc= mysql_stmt_prepare(stmt, SL("INSERT INTO t1 (a,b) VALUES (NULL, '[incorrect json]') RETURNING a")); + check_stmt_rc(rc, stmt); + + rc= mysql_stmt_execute(stmt); + check_stmt_rc(rc, stmt); + + rc= mysql_stmt_close(stmt); + + return OK; +} + struct my_tests_st my_tests[] = { + {"test_returning", test_returning, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_mdev_21920", test_mdev_21920, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_maxparam", test_maxparam, TEST_CONNECTION_NEW, 0, NULL, NULL}, {"test_conc424", test_conc424, TEST_CONNECTION_NEW, 0, NULL, NULL},