Debian Codegraph @

mysql-test/suite/x/t/insert_table_bad_column.test

raw
1 ## generated
2 ## Rel: Insert on a table with invalid columns
3
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6
7 create schema xtest default charset='utf8mb4';
8
9 ## Test starts here
10 --write_file $MYSQL_TMP_DIR/insert_table_bad_column.xpl
11 ## Test data
12 -->sql
13 use xtest;
14 create table mytable (i int NOT NULL, ui int unsigned, vc varchar(100), f float, d double, dt datetime, ts timestamp(5), j json);
15 -->endsql
16
17 Mysqlx.Crud.Insert {
18 collection {
19 name: "mytable"
20 schema: "xtest"
21 }
22 data_model: TABLE
23 projection {
24 name: "badcol"
25 }
26 projection {
27 name: "ui"
28 }
29 projection {
30 name: "vc"
31 }
32 projection {
33 name: "f"
34 }
35 projection {
36 name: "d"
37 }
38 projection {
39 name: "dt"
40 }
41 projection {
42 name: "ts"
43 }
44 projection {
45 name: "j"
46 }
47 row {
48 field {
49 type: LITERAL
50 literal {
51 type: V_SINT
52 v_signed_int: -100
53 }
54 }
55 field {
56 type: LITERAL
57 literal {
58 type: V_UINT
59 v_unsigned_int: 100
60 }
61 }
62 field {
63 type: LITERAL
64 literal {
65 type: V_STRING
66 v_string {
67 value: ""
68 }
69 }
70 }
71 field {
72 type: LITERAL
73 literal {
74 type: V_FLOAT
75 v_float: 0.333333
76 }
77 }
78 field {
79 type: LITERAL
80 literal {
81 type: V_DOUBLE
82 v_double: 0.333333333333
83 }
84 }
85 field {
86 type: LITERAL
87 literal {
88 type: V_STRING
89 v_string {
90 value: "2015-05-05 1:20:30"
91 }
92 }
93 }
94 field {
95 type: LITERAL
96 literal {
97 type: V_STRING
98 v_string {
99 value: "2015-06-06 03:10:20.12345"
100 }
101 }
102 }
103 field {
104 type: LITERAL
105 literal {
106 type: V_STRING
107 v_string {
108 value: "{\"name\":\"Me\"}"
109 }
110 }
111 }
112 }
113 }
114
115 ## expect Mysqlx.Error
116 -->recv
117 EOF
118
119 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/insert_table_bad_column.xpl 2>&1
120
121 ## Cleanup
122 --source ../include/xplugin_cleanup.inc