| 1 |
CREATE SCHEMA IF NOT EXISTS xtest; |
| 2 |
USE xtest; |
| 3 |
CREATE TABLE xtable (phrase VARCHAR(30)); |
| 4 |
INSERT INTO xtable (phrase) VALUES ('Alice has a cat'); |
| 5 |
INSERT INTO xtable (phrase) VALUES ('Bob has a dog'); |
| 6 |
|
| 7 |
Stmt 1: Prepare malformed stmt |
| 8 |
============================== |
| 9 |
Got expected error: |
| 10 |
Mysqlx.Error { |
| 11 |
severity: ERROR |
| 12 |
code: 1064 |
| 13 |
msg: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'BLA BLA\' at line 1" |
| 14 |
sql_state: "42000" |
| 15 |
} |
| 16 |
|
| 17 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 1] |
| 18 |
|
| 19 |
Stmt 1: Try to execute |
| 20 |
====================== |
| 21 |
Got expected error: Statement with ID=1 was not prepared (code 5110) |
| 22 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 1] |
| 23 |
|
| 24 |
Stmt 1: Try to deallocate |
| 25 |
========================= |
| 26 |
Got expected error: |
| 27 |
Mysqlx.Error { |
| 28 |
severity: ERROR |
| 29 |
code: 5110 |
| 30 |
msg: "Statement with ID=1 was not prepared" |
| 31 |
sql_state: "HY000" |
| 32 |
} |
| 33 |
|
| 34 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 1] |
| 35 |
|
| 36 |
Stmt 2: Prepare correct stmt (no placeholders) |
| 37 |
============================================== |
| 38 |
RUN recvok |
| 39 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 2] |
| 40 |
|
| 41 |
Stmt 2: Execute (no params) |
| 42 |
=========================== |
| 43 |
phrase |
| 44 |
Alice has a cat |
| 45 |
Bob has a dog |
| 46 |
0 rows affected |
| 47 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 2] |
| 48 |
|
| 49 |
Stmt 2: Execute (one extra param to ignore) |
| 50 |
=========================================== |
| 51 |
phrase |
| 52 |
Alice has a cat |
| 53 |
Bob has a dog |
| 54 |
0 rows affected |
| 55 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 3] |
| 56 |
|
| 57 |
Stmt 2: Deallocate |
| 58 |
================== |
| 59 |
RUN recvok |
| 60 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 2] |
| 61 |
|
| 62 |
Stmt 3: Prepare correct stmt (one placeholder) |
| 63 |
============================================== |
| 64 |
RUN recvok |
| 65 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 3] |
| 66 |
|
| 67 |
Stmt 3: Try to execute (no params) |
| 68 |
================================== |
| 69 |
Got expected error: There is no argument for statement placeholder at position: 0 (code 5134) |
| 70 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 4] |
| 71 |
|
| 72 |
Stmt 3: Execute with param |
| 73 |
========================== |
| 74 |
phrase |
| 75 |
Alice has a cat |
| 76 |
0 rows affected |
| 77 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 5] |
| 78 |
|
| 79 |
Stmt 3: Execute with params (one extra to ignore) |
| 80 |
================================================= |
| 81 |
phrase |
| 82 |
Bob has a dog |
| 83 |
0 rows affected |
| 84 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 6] |
| 85 |
|
| 86 |
Stmt 3: Deallocate |
| 87 |
================== |
| 88 |
RUN recvok |
| 89 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 3] |
| 90 |
|
| 91 |
Stmt 4: Prepare correct stmt (insert) |
| 92 |
===================================== |
| 93 |
RUN recvok |
| 94 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 4] |
| 95 |
|
| 96 |
Stmt 4: Execute (one param) |
| 97 |
=========================== |
| 98 |
|
| 99 |
1 rows affected |
| 100 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 7] |
| 101 |
phrase |
| 102 |
Alice has a cat |
| 103 |
Bob has a dog |
| 104 |
Christina has a hamster |
| 105 |
0 rows affected |
| 106 |
|
| 107 |
Stmt 4: Deallocate |
| 108 |
================== |
| 109 |
RUN recvok |
| 110 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 4] |
| 111 |
|
| 112 |
Stmt 5: Prepare correct stmt (update) |
| 113 |
===================================== |
| 114 |
RUN recvok |
| 115 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 5] |
| 116 |
|
| 117 |
Stmt 5: Execute (one param) |
| 118 |
=========================== |
| 119 |
|
| 120 |
1 rows affected |
| 121 |
Rows matched: 1 Changed: 1 Warnings: 0 |
| 122 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 8] |
| 123 |
phrase |
| 124 |
David has a parot |
| 125 |
Bob has a dog |
| 126 |
Christina has a hamster |
| 127 |
0 rows affected |
| 128 |
|
| 129 |
Stmt 5: Deallocate |
| 130 |
================== |
| 131 |
RUN recvok |
| 132 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 5] |
| 133 |
|
| 134 |
Stmt 6: Prepare correct stmt (delete) |
| 135 |
===================================== |
| 136 |
RUN recvok |
| 137 |
Verify [Status variable "Mysqlx_prep_prepare" needs to have a value of 6] |
| 138 |
|
| 139 |
Stmt 6: Execute (one param) |
| 140 |
=========================== |
| 141 |
|
| 142 |
1 rows affected |
| 143 |
Verify [Status variable "Mysqlx_prep_execute" needs to have a value of 9] |
| 144 |
phrase |
| 145 |
David has a parot |
| 146 |
Christina has a hamster |
| 147 |
0 rows affected |
| 148 |
|
| 149 |
Stmt 5: Deallocate |
| 150 |
================== |
| 151 |
RUN recvok |
| 152 |
Verify [Status variable "Mysqlx_prep_deallocate" needs to have a value of 6] |
| 153 |
Mysqlx.Ok { |
| 154 |
msg: "bye!" |
| 155 |
} |
| 156 |
ok |