## generated ## Rel: Insert a row with mismatched number of column/params --source include/xplugin_preamble.inc --source include/xplugin_create_user.inc create schema xtest default charset='utf8mb4'; ## Test starts here --write_file $MYSQL_TMP_DIR/insert_table_bad_numcolumns.tmp ## Test data -->sql use xtest; create table mytable (i int NOT NULL, ui int unsigned, vc varchar(100), f float, d double, dt datetime, ts timestamp(5), j json); -->endsql Mysqlx.Crud.Insert { collection { name: "mytable" schema: "xtest" } data_model: TABLE projection { name: "i" } projection { name: "ui" } projection { name: "vc" } projection { name: "f" } projection { name: "d" } projection { name: "dt" } projection { name: "ts" } projection { name: "j" } row { field { type: LITERAL literal { type: V_SINT v_signed_int: -100 } } field { type: LITERAL literal { type: V_UINT v_unsigned_int: 100 } } field { type: LITERAL literal { type: V_STRING v_string { value: "" } } } field { type: LITERAL literal { type: V_FLOAT v_float: 0.333333 } } field { type: LITERAL literal { type: V_DOUBLE v_double: 0.333333333333 } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-05-05 1:20:30" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-06-06 03:10:20.12345" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "{\"name\":\"Me\"}" } } } field { type: LITERAL literal { type: V_SINT v_signed_int: 1234 } } } } ## expect Mysqlx.Error -->recv Mysqlx.Crud.Insert { collection { name: "mytable" schema: "xtest" } data_model: TABLE projection { name: "ui" } projection { name: "vc" } projection { name: "f" } projection { name: "d" } projection { name: "dt" } projection { name: "ts" } projection { name: "j" } row { field { type: LITERAL literal { type: V_SINT v_signed_int: -100 } } field { type: LITERAL literal { type: V_UINT v_unsigned_int: 100 } } field { type: LITERAL literal { type: V_STRING v_string { value: "" } } } field { type: LITERAL literal { type: V_FLOAT v_float: 0.333333 } } field { type: LITERAL literal { type: V_DOUBLE v_double: 0.333333333333 } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-05-05 1:20:30" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-06-06 03:10:20.12345" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "{\"name\":\"Me\"}" } } } } } ## expect Mysqlx.Error -->recv Mysqlx.Crud.Insert { collection { name: "mytable" schema: "xtest" } data_model: TABLE projection { name: "i" } projection { name: "ui" } projection { name: "vc" } projection { name: "f" } projection { name: "d" } projection { name: "dt" } projection { name: "ts" } projection { name: "j" } row { field { type: LITERAL literal { type: V_UINT v_unsigned_int: 100 } } field { type: LITERAL literal { type: V_STRING v_string { value: "" } } } field { type: LITERAL literal { type: V_FLOAT v_float: 0.333333 } } field { type: LITERAL literal { type: V_DOUBLE v_double: 0.333333333333 } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-05-05 1:20:30" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "2015-06-06 03:10:20.12345" } } } field { type: LITERAL literal { type: V_STRING v_string { value: "{\"name\":\"Me\"}" } } } } } ## expect Mysqlx.Error -->recv Mysqlx.Sql.StmtExecute { stmt: "select count(*) from xtest.mytable" } ## expect Mysqlx.Resultset.ColumnMetaData -->recv ## expect Mysqlx.Resultset.Row -->recv ## expect Mysqlx.Resultset.FetchDone -->recv ## expect Notice -->recv ## expect Mysqlx.Sql.StmtExecuteOk -->recv EOF --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/insert_table_bad_numcolumns.tmp 2>&1 ## Cleanup drop schema if exists xtest; --remove_file $MYSQL_TMP_DIR/insert_table_bad_numcolumns.tmp --source include/xplugin_drop_user.inc