diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tests/mysql_client_test.c | 53 |
2 files changed, 56 insertions, 7 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7559ca9ec6b..2093fc0da36 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,15 +13,15 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +# About "mysqlclient_notls", see note in "client/CMakeLists.txt" +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS("-DMYSQL_CLIENT") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) -ADD_EXECUTABLE(mysql_client_test mysql_client_test.c) -TARGET_LINK_LIBRARIES(mysql_client_test dbug mysys mysqlclient yassl taocrypt zlib wsock32) +ADD_EXECUTABLE(mysql_client_test mysql_client_test.c ../mysys/my_memmem.c) +TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32) ADD_EXECUTABLE(bug25714 bug25714.c) -TARGET_LINK_LIBRARIES(bug25714 dbug mysys mysqlclient yassl taocrypt zlib wsock32) +TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index ca76270d8b8..dd6b0b5585f 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -15570,7 +15570,7 @@ static void test_bug27876() int rc; MYSQL_RES *result; - char utf8_func[] = + unsigned char utf8_func[] = { 0xd1, 0x84, 0xd1, 0x83, 0xd0, 0xbd, 0xd0, 0xba, 0xd1, 0x86, 0xd0, 0xb8, 0xd0, 0xb9, 0xd0, 0xba, @@ -15578,7 +15578,7 @@ static void test_bug27876() 0x00 }; - char utf8_param[] = + unsigned char utf8_param[] = { 0xd0, 0xbf, 0xd0, 0xb0, 0xd1, 0x80, 0xd0, 0xb0, 0xd0, 0xbc, 0xd0, 0xb5, 0xd1, 0x82, 0xd1, 0x8a, @@ -15808,6 +15808,54 @@ static void test_bug29948() mysql_close(dbc); } +/** + Bug#29306 Truncated data in MS Access with decimal (3,1) columns in a VIEW +*/ + +static void test_bug29306() +{ + MYSQL_FIELD *field; + int rc; + MYSQL_RES *res; + + DBUG_ENTER("test_bug29306"); + myheader("test_bug29306"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS tab17557"); + myquery(rc); + rc= mysql_query(mysql, "DROP VIEW IF EXISTS view17557"); + myquery(rc); + rc= mysql_query(mysql, "CREATE TABLE tab17557 (dd decimal (3,1))"); + myquery(rc); + rc= mysql_query(mysql, "CREATE VIEW view17557 as SELECT dd FROM tab17557"); + myquery(rc); + rc= mysql_query(mysql, "INSERT INTO tab17557 VALUES (7.6)"); + myquery(rc); + + /* Checking the view */ + res= mysql_list_fields(mysql, "view17557", NULL); + while ((field= mysql_fetch_field(res))) + { + if (! opt_silent) + { + printf("field name %s\n", field->name); + printf("field table %s\n", field->table); + printf("field decimals %d\n", field->decimals); + if (field->decimals < 1) + printf("Error! No decimals! \n"); + printf("\n\n"); + } + DIE_UNLESS(field->decimals == 1); + } + mysql_free_result(res); + + rc= mysql_query(mysql, "DROP TABLE tab17557"); + myquery(rc); + rc= mysql_query(mysql, "DROP VIEW view17557"); + myquery(rc); + + DBUG_VOID_RETURN; +} /* Read and parse arguments and MySQL options from my.cnf @@ -16094,6 +16142,7 @@ static struct my_tests_st my_tests[]= { { "test_bug28934", test_bug28934 }, { "test_bug27592", test_bug27592 }, { "test_bug29948", test_bug29948 }, + { "test_bug29306", test_bug29306 }, { 0, 0 } }; |