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

Fix for CONC-160: field metadata doesn't show NUM_FLAG for NEWDECIMAL

columns
This commit is contained in:
Georg Richter
2016-02-20 11:52:17 +01:00
parent 27a66aa11c
commit 9818a85c1d
3 changed files with 21 additions and 2 deletions

View File

@@ -87,7 +87,7 @@ extern unsigned int mariadb_deinitialize_ssl;
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR || (f)->type == MYSQL_TYPE_NEWDECIMAL || (f)->type == MYSQL_TYPE_DECIMAL)
typedef struct st_mysql_field {
char *name; /* Name of column */

View File

@@ -1027,9 +1027,28 @@ DROP TABLE IF EXISTS test_multi_tab";
return OK;
}
static int test_conc160(MYSQL *mysql)
{
MYSQL_RES *result;
MYSQL_FIELD *field;
int rc;
rc= mysql_query(mysql, "SELECT cast(1.234 AS DECIMAL)");
check_mysql_rc(rc, mysql);
result= mysql_store_result(mysql);
field= mysql_fetch_field(result);
FAIL_UNLESS(field->flags & NUM_FLAG, "Numceric flag not set");
mysql_free_result(result);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_conc160", test_conc160, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"client_store_result", client_store_result, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"client_use_result", client_use_result, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_free_result", test_free_result, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},

View File

@@ -823,7 +823,7 @@ static int test_schannel_cipher(MYSQL *mysql)
struct my_tests_st my_tests[] = {
{"test_ssl", test_ssl, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc127", test_conc127, TEST_CONNECTION_NEW, 0, NULL, NULL},
// {"test_conc127", test_conc127, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_ssl_fp", test_ssl_fp, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_ssl_fp_list", test_ssl_fp_list, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc50", test_conc50, TEST_CONNECTION_NEW, 0, NULL, NULL},