187 lines
2.8 KiB
Plaintext
187 lines
2.8 KiB
Plaintext
RUN create schema xtest default charset 'utf8mb4'
|
|
|
|
1 rows affected
|
|
RUN use xtest
|
|
|
|
0 rows affected
|
|
RUN create table mytable (a int)
|
|
|
|
0 rows affected
|
|
RUN create table mytable2 (a int, doc json)
|
|
|
|
0 rows affected
|
|
RUN create view myview as select 1
|
|
|
|
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
|
|
RUN create view fakecoll as select * from xtest.books
|
|
|
|
|
|
0 rows affected
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
name type
|
|
books COLLECTION
|
|
fakecoll VIEW
|
|
mytable TABLE
|
|
mytable2 TABLE
|
|
myview VIEW
|
|
command ok
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "invalid"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
Got expected error: Unknown database 'invalid' (code 1049)
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "myt%"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
name type
|
|
mytable TABLE
|
|
mytable2 TABLE
|
|
command ok
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "bla%"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
name type
|
|
command ok
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
name type
|
|
books COLLECTION
|
|
fakecoll VIEW
|
|
mytable TABLE
|
|
mytable2 TABLE
|
|
myview VIEW
|
|
command ok
|
|
RUN ALTER TABLE xtest.books ADD COLUMN (nothing INT)
|
|
|
|
0 rows affected
|
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
RUN show columns from xtest.books
|
|
Field Type Null Key Default Extra
|
|
doc json YES null
|
|
_id varbinary(32) NO PRI null STORED GENERATED
|
|
nothing int(11) YES null
|
|
0 rows affected
|
|
send Mysqlx.Sql.StmtExecute {
|
|
stmt: "list_objects"
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "xtest"
|
|
}
|
|
}
|
|
}
|
|
args {
|
|
type: SCALAR
|
|
scalar {
|
|
type: V_STRING
|
|
v_string {
|
|
value: "books"
|
|
}
|
|
}
|
|
}
|
|
namespace: "xplugin"
|
|
}
|
|
|
|
name type
|
|
books TABLE
|
|
command ok
|
|
Mysqlx.Ok {
|
|
msg: "bye!"
|
|
}
|
|
ok
|
|
drop schema if exists xtest;
|