config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/x/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/x/t/crud_find_doc_criteria.test

## Doc: Find using docpaths in expression 
--source ../include/xplugin_preamble.inc

DROP SCHEMA IF EXISTS xtest;
CREATE SCHEMA xtest DEFAULT CHARSET 'utf8mb4';
CREATE TABLE xtest.xcoll (doc JSON, _id VARBINARY(16) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id'))) STORED PRIMARY KEY);
INSERT INTO xtest.xcoll (doc) VALUES ('{"_id": "1", "name": "Anabel"}');

CREATE TABLE xtest.ycoll (ydoc JSON, _id VARBINARY(16) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(ydoc, '$._id'))) STORED PRIMARY KEY);
INSERT INTO xtest.ycoll (ydoc) VALUES ('{"_id": "1", "name": "Anabel"}');

CREATE TABLE xtest.zcoll (doc JSON, _zid VARBINARY(16) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id'))) STORED PRIMARY KEY);
INSERT INTO xtest.zcoll (doc) VALUES ('{"_id": "1", "name": "Anabel"}');

## Test starts here
--write_file $MYSQL_TMP_DIR/crud_find_doc_criteria.tmp
## Test data
-->quiet
-->macro Find_value	%COLL%	%IDENT%	%VALUE%	%ERROR%
Mysqlx.Crud.Find {
  collection {
    name: "%COLL%"
    schema: "xtest"
  }
  data_model: DOCUMENT
  criteria {
    type: OPERATOR
    operator {
      name: "=="
      param {
        type: IDENT
        identifier {
          %IDENT%
        }
      }
      param {
        type: LITERAL
        literal {
          type: V_OCTETS
          v_octets {value: "%VALUE%"}
        }
      }
    }
  }
}
-->expecterror %ERROR%
-->recvresult
-->endmacro

-->title * xcoll is corect collection
-->callmacro Find_value	xcoll	name:"_id"	1	ER_SUCCESS
-->callmacro Find_value	xcoll	name:"_id"	no_data	ER_SUCCESS
-->callmacro Find_value	xcoll	name:"doc"	no_data	ER_SUCCESS
-->callmacro Find_value	xcoll	document_path{type:MEMBER value:"name"}	Anabel	ER_SUCCESS
-->callmacro Find_value	xcoll	document_path{type:MEMBER value:"name"}	no_data	ER_SUCCESS
-->callmacro Find_value	xcoll	name:"name"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING

-->title * ycoll is not corect collection; missing `doc` column
-->callmacro Find_value	ycoll	name:"_id"	1	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	ycoll	name:"_id"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	ycoll	name:"doc"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	ycoll	document_path{type:MEMBER value:"name"}	Anabel	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	ycoll	document_path{type:MEMBER value:"name"}	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	ycoll	name:"name"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING

-->title * zcoll is not corect collection; missing `_id` column
-->callmacro Find_value	zcoll	name:"_id"	1	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	zcoll	name:"_id"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING
-->callmacro Find_value	zcoll	name:"doc"	no_data	ER_SUCCESS
-->callmacro Find_value	zcoll	document_path{type:MEMBER value:"name"}	Anabel	ER_SUCCESS
-->callmacro Find_value	zcoll	document_path{type:MEMBER value:"name"}	no_data	ER_SUCCESS
-->callmacro Find_value	zcoll	name:"name"	no_data	ER_X_DOC_REQUIRED_FIELD_MISSING
EOF

--exec $MYSQLXTEST -uroot --password='' --file=$MYSQL_TMP_DIR/crud_find_doc_criteria.tmp 2>&1


## Cleanup
--remove_file $MYSQL_TMP_DIR/crud_find_doc_criteria.tmp

## Postamble
DROP SCHEMA IF EXISTS xtest;
UNINSTALL PLUGIN mysqlx;

Man Man