227 lines
3.2 KiB
Plaintext
227 lines
3.2 KiB
Plaintext
RUN drop schema if exists xtest
|
|
|
|
0 rows affected
|
|
RUN create schema xtest default charset 'utf8mb4'
|
|
|
|
1 rows affected
|
|
RUN use xtest
|
|
|
|
0 rows affected
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "create_collection"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "books"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
|
|
command ok
|
|
Namespace 'xplugin' is deprecated, please use 'mysqlx' instead
|
|
send Mysqlx.Crud.Insert {
|
|
collection {
|
|
name: "books"
|
|
schema: "xtest"
|
|
}
|
|
data_model: DOCUMENT
|
|
row {
|
|
field {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "{\"_id\": \"one\", \"name\": \"The Bla\"}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
1 rows affected
|
|
send Mysqlx.Crud.Insert {
|
|
collection {
|
|
name: "books"
|
|
schema: "xtest"
|
|
}
|
|
data_model: DOCUMENT
|
|
row {
|
|
field {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "{\"_id\": \"two\", \"name\": \"The Bla II\"}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
1 rows affected
|
|
send Mysqlx.Crud.Insert {
|
|
collection {
|
|
name: "books"
|
|
schema: "xtest"
|
|
}
|
|
data_model: DOCUMENT
|
|
row {
|
|
field {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "{\"_id\": \"one\", \"name\": \"The Bla II\"}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Mysqlx.Error {
|
|
severity: ERROR
|
|
code: 5116
|
|
msg: "Document contains a field value that is not unique but required to be"
|
|
sql_state: "HY000"
|
|
}
|
|
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "drop_collection"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "books"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
|
|
command ok
|
|
Negative cases now
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "create_collection"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: ""
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: ""
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
Mysqlx.Error {
|
|
severity: ERROR
|
|
code: 5112
|
|
msg: "Invalid schema"
|
|
sql_state: "HY000"
|
|
}
|
|
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "create_collection"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: ""
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
Mysqlx.Error {
|
|
severity: ERROR
|
|
code: 5113
|
|
msg: "Invalid collection name"
|
|
sql_state: "HY000"
|
|
}
|
|
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "create_collection"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "\000"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
Mysqlx.Error {
|
|
severity: ERROR
|
|
code: 5017
|
|
msg: "Invalid value for argument \'name\'"
|
|
sql_state: "HY000"
|
|
}
|
|
|
|
RUN drop schema if exists xtest
|
|
|
|
0 rows affected
|
|
Mysqlx.Ok {
|
|
msg: "bye!"
|
|
}
|
|
ok
|