| 1 |
## Test of general functionality of prepare statement |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
## Test starts here |
| 7 |
|
| 8 |
--write_file $MYSQL_TMP_DIR/prep_stmt_pipeline.xpl |
| 9 |
-->import assert_variable.macro |
| 10 |
-->quiet |
| 11 |
|
| 12 |
-->echo |
| 13 |
-->echo ## 1. Verify pipelining of single prepare-execute request |
| 14 |
-->echo # a. prepare-execute |
| 15 |
-->echo # b. prepare-execute-cursor_open |
| 16 |
-->echo ## 2. Verify pipelining of mixed prepare-execute requests |
| 17 |
-->echo # a. prepare1-preapre2-execute1-execute2 |
| 18 |
-->echo # b. prepare1-preapre2-execute1-deallocate1-execute2-deallocate2 |
| 19 |
|
| 20 |
-->title = 1.a. Verify pipelining of single prepare-execute request (prepeare-execute) |
| 21 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 22 |
Mysqlx.Prepare.Prepare { |
| 23 |
stmt_id: 1 |
| 24 |
stmt: { |
| 25 |
type: STMT |
| 26 |
stmt_execute: { |
| 27 |
stmt: "select 1" |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 32 |
Mysqlx.Prepare.Execute { |
| 33 |
stmt_id: 1 |
| 34 |
} |
| 35 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 36 |
-->recvok |
| 37 |
echo # Receive Mysqlx.Prepare.Execute; |
| 38 |
-->recvresult |
| 39 |
|
| 40 |
-->title = 1.b. Verify pipelining of single prepare-execute request (prepeare-execute-cursor_open) |
| 41 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 42 |
Mysqlx.Prepare.Prepare { |
| 43 |
stmt_id: 2 |
| 44 |
stmt: { |
| 45 |
type: STMT |
| 46 |
stmt_execute: { |
| 47 |
stmt: "select 2" |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 52 |
Mysqlx.Prepare.Execute { |
| 53 |
stmt_id: 2 |
| 54 |
} |
| 55 |
echo # Pipeline Mysqlx.Cursor.Open; |
| 56 |
Mysqlx.Cursor.Open { |
| 57 |
cursor_id: 2 |
| 58 |
stmt { |
| 59 |
type: PREPARE_EXECUTE |
| 60 |
prepare_execute { |
| 61 |
stmt_id: 2 |
| 62 |
} |
| 63 |
} |
| 64 |
} |
| 65 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 66 |
-->recvok |
| 67 |
echo # Receive Mysqlx.Prepare.Execute; |
| 68 |
-->recvresult |
| 69 |
echo # Receive Mysqlx.Cursor.Open; |
| 70 |
-->recvresult |
| 71 |
|
| 72 |
-->title = 2.a. Verify pipelining of mixed prepare-execute request (prepeare1-prepeare2-execute1-execute2) |
| 73 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 74 |
Mysqlx.Prepare.Prepare { |
| 75 |
stmt_id: 3 |
| 76 |
stmt: { |
| 77 |
type: STMT |
| 78 |
stmt_execute: { |
| 79 |
stmt: "select 3" |
| 80 |
} |
| 81 |
} |
| 82 |
} |
| 83 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 84 |
Mysqlx.Prepare.Prepare { |
| 85 |
stmt_id: 4 |
| 86 |
stmt: { |
| 87 |
type: STMT |
| 88 |
stmt_execute: { |
| 89 |
stmt: "select 4" |
| 90 |
} |
| 91 |
} |
| 92 |
} |
| 93 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 94 |
Mysqlx.Prepare.Execute { |
| 95 |
stmt_id: 3 |
| 96 |
} |
| 97 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 98 |
Mysqlx.Prepare.Execute { |
| 99 |
stmt_id: 4 |
| 100 |
} |
| 101 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 102 |
-->recvok |
| 103 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 104 |
-->recvok |
| 105 |
echo # Receive Mysqlx.Prepare.Execute; |
| 106 |
-->recvresult |
| 107 |
echo # Receive Mysqlx.Prepare.Execute; |
| 108 |
-->recvresult |
| 109 |
|
| 110 |
-->title = 2.b. Verify pipelining of mixed prepare-execute request (prepeare1-prepeare2-execute1-deallocate1-execute2-deallocate2) |
| 111 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 112 |
Mysqlx.Prepare.Prepare { |
| 113 |
stmt_id: 5 |
| 114 |
stmt: { |
| 115 |
type: STMT |
| 116 |
stmt_execute: { |
| 117 |
stmt: "select 5" |
| 118 |
} |
| 119 |
} |
| 120 |
} |
| 121 |
echo # Pipeline Mysqlx.Prepare.Prepare; |
| 122 |
Mysqlx.Prepare.Prepare { |
| 123 |
stmt_id: 6 |
| 124 |
stmt: { |
| 125 |
type: STMT |
| 126 |
stmt_execute: { |
| 127 |
stmt: "select 6" |
| 128 |
} |
| 129 |
} |
| 130 |
} |
| 131 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 132 |
Mysqlx.Prepare.Execute { |
| 133 |
stmt_id: 5 |
| 134 |
} |
| 135 |
echo # Pipeline Mysqlx.Prepare.Deallocate; |
| 136 |
Mysqlx.Prepare.Deallocate { |
| 137 |
stmt_id: 5 |
| 138 |
} |
| 139 |
echo # Pipeline Mysqlx.Prepare.Execute; |
| 140 |
Mysqlx.Prepare.Execute { |
| 141 |
stmt_id: 6 |
| 142 |
} |
| 143 |
echo # Pipeline Mysqlx.Prepare.Deallocate; |
| 144 |
Mysqlx.Prepare.Deallocate { |
| 145 |
stmt_id: 6 |
| 146 |
} |
| 147 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 148 |
-->recvok |
| 149 |
echo # Receive Mysqlx.Prepare.Prepare; |
| 150 |
-->recvok |
| 151 |
echo # Receive Mysqlx.Prepare.Execute; |
| 152 |
-->recvresult |
| 153 |
echo # Receive Mysqlx.Prepare.Deallocate; |
| 154 |
-->recvok |
| 155 |
echo # Receive Mysqlx.Prepare.Execute; |
| 156 |
-->recvresult |
| 157 |
echo # Receive Mysqlx.Prepare.Deallocate; |
| 158 |
-->recvok |
| 159 |
|
| 160 |
EOF |
| 161 |
|
| 162 |
exec $MYSQLXTEST |
| 163 |
-ux_root --password='' --schema test |
| 164 |
--file=$MYSQL_TMP_DIR/prep_stmt_pipeline.xpl 2>&1; |
| 165 |
|
| 166 |
|
| 167 |
## Cleanup |
| 168 |
--source ../include/xplugin_cleanup.inc |