Debian Codegraph @

mysql-test/suite/x/r/session_reset.result

raw
1 # restart
2 call mtr.add_suppression("Plugin mysqlx reported: '.*: Unhandled message of type 12'");
3 select sleep(1);
4 sleep(1)
5 0
6 SELECT `user`,`host`,`db`,`command`,`state`,`info` FROM INFORMATION_SCHEMA.PROCESSLIST WHERE `state` != 'cleaning up' ORDER BY user ASC;
7 user host db command state info
8 event_scheduler localhost NULL Daemon Waiting on empty queue NULL
9 root localhost test Query executing SELECT `user`,`host`,`db`,`command`,`state`,`info` FROM INFORMATION_SCHEMA.PROCESSLIST WHERE `state` != 'cleaning up' ORDER BY user ASC
10 Warnings:
11 Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
12
13 ## A. Execute the Session reset without compression
14 #
15 ## 1. Execute Reset using basic scenarios
16 # a. verify that reset without args removes current session
17 # b. verify that reset with keep_open=false removes current session
18 # c. verify that close removes current session
19 ## 2. Execute Reset with pipelined stmt-execute
20 # a. verify that reset without args removes current session
21 # b. verify that reset with keep_open=false removes current session
22 # c. verify that close removes current session
23 ## 3. Execute Reset and check that prepared-stmts are removed
24 # a. verify that reset without args removes current session and prepared-statemtents
25 # b. verify that reset with keep_open=false removes current session and prepared-statemtents
26 # c. verify that close removes current session and prepared-statemtents
27
28 ## 1.a
29 #
30
31 Session reset (Session_reset_empty)
32 ===================================
33 send Mysqlx.Session.Reset {
34 }
35
36 RUN recvok
37 Login OK
38 send Mysqlx.Sql.StmtExecute {
39 stmt: "select 1.1"
40 }
41
42 1.1
43 1.1
44 0 rows affected
45 send Mysqlx.Sql.StmtExecute {
46 stmt: "select 2.1"
47 }
48
49 send Mysqlx.Sql.StmtExecute {
50 stmt: "select 2.2"
51 }
52
53 send Mysqlx.Session.Reset {
54 }
55
56 2.1
57 2.1
58 0 rows affected
59 2.2
60 2.2
61 0 rows affected
62 RUN recvok
63 Login OK
64 send Mysqlx.Session.Reset {
65 }
66
67 RUN recvok
68 send Mysqlx.Sql.StmtExecute {
69 stmt: "select 3.1"
70 }
71
72 Mysqlx.Error {
73 severity: FATAL
74 code: 5000
75 msg: "Invalid message"
76 sql_state: "HY000"
77 }
78
79 connecting...
80 active session is now 'foo'
81 RUN set @secret = 12345
82
83 0 rows affected
84 send Mysqlx.Session.Reset {
85 }
86
87 RUN recvok
88 Login OK
89 RUN select IF(@secret is NULL, 'OK', 'FAIL')
90 IF(@secret is NULL, 'OK', 'FAIL')
91 OK
92 0 rows affected
93 closing session foo
94 Mysqlx.Ok {
95 msg: "bye!"
96 }
97 switched to session default
98 connecting...
99 active session is now 'foobar'
100 RUN set global max_connections = 1234
101
102
103 0 rows affected
104 send Mysqlx.Session.Reset {
105 }
106
107 RUN recvok
108 Login OK
109 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
110 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
111 OK
112 0 rows affected
113 RUN set @@global.max_connections = default
114
115 0 rows affected
116 closing session foobar
117 Mysqlx.Ok {
118 msg: "bye!"
119 }
120 switched to session default
121 connecting...
122 active session is now 'bar'
123 send Mysqlx.Expect.Open {
124 cond {
125 condition_key: 1
126 }
127 }
128
129 RUN recvok
130 send Mysqlx.Session.Reset {
131 }
132
133 RUN recvok
134 Login OK
135 send Mysqlx.Expect.Close {
136 }
137
138 Got expected error:
139 Mysqlx.Error {
140 severity: ERROR
141 code: 5158
142 msg: "Expect block currently not open"
143 sql_state: "HY000"
144 }
145
146 closing session bar
147 Mysqlx.Ok {
148 msg: "bye!"
149 }
150 ok
151
152 ## 1.b
153 #
154
155 Session reset (Session_reset)
156 =============================
157 send Mysqlx.Session.Reset {
158 keep_open: false
159 }
160
161 RUN recvok
162 Login OK
163 send Mysqlx.Sql.StmtExecute {
164 stmt: "select 1.1"
165 }
166
167 1.1
168 1.1
169 0 rows affected
170 send Mysqlx.Sql.StmtExecute {
171 stmt: "select 2.1"
172 }
173
174 send Mysqlx.Sql.StmtExecute {
175 stmt: "select 2.2"
176 }
177
178 send Mysqlx.Session.Reset {
179 keep_open: false
180 }
181
182 2.1
183 2.1
184 0 rows affected
185 2.2
186 2.2
187 0 rows affected
188 RUN recvok
189 Login OK
190 send Mysqlx.Session.Reset {
191 keep_open: false
192 }
193
194 RUN recvok
195 send Mysqlx.Sql.StmtExecute {
196 stmt: "select 3.1"
197 }
198
199 Mysqlx.Error {
200 severity: FATAL
201 code: 5000
202 msg: "Invalid message"
203 sql_state: "HY000"
204 }
205
206 connecting...
207 active session is now 'foo'
208 RUN set @secret = 12345
209
210 0 rows affected
211 send Mysqlx.Session.Reset {
212 keep_open: false
213 }
214
215 RUN recvok
216 Login OK
217 RUN select IF(@secret is NULL, 'OK', 'FAIL')
218 IF(@secret is NULL, 'OK', 'FAIL')
219 OK
220 0 rows affected
221 closing session foo
222 Mysqlx.Ok {
223 msg: "bye!"
224 }
225 switched to session default
226 connecting...
227 active session is now 'foobar'
228 RUN set global max_connections = 1234
229
230
231 0 rows affected
232 send Mysqlx.Session.Reset {
233 keep_open: false
234 }
235
236 RUN recvok
237 Login OK
238 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
239 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
240 OK
241 0 rows affected
242 RUN set @@global.max_connections = default
243
244 0 rows affected
245 closing session foobar
246 Mysqlx.Ok {
247 msg: "bye!"
248 }
249 switched to session default
250 connecting...
251 active session is now 'bar'
252 send Mysqlx.Expect.Open {
253 cond {
254 condition_key: 1
255 }
256 }
257
258 RUN recvok
259 send Mysqlx.Session.Reset {
260 keep_open: false
261 }
262
263 RUN recvok
264 Login OK
265 send Mysqlx.Expect.Close {
266 }
267
268 Got expected error:
269 Mysqlx.Error {
270 severity: ERROR
271 code: 5158
272 msg: "Expect block currently not open"
273 sql_state: "HY000"
274 }
275
276 closing session bar
277 Mysqlx.Ok {
278 msg: "bye!"
279 }
280 ok
281
282 ## 1.c
283 #
284
285 Session reset (Session_close)
286 =============================
287 send Mysqlx.Session.Close {
288 }
289
290 RUN recvok
291 Login OK
292 send Mysqlx.Sql.StmtExecute {
293 stmt: "select 1.1"
294 }
295
296 1.1
297 1.1
298 0 rows affected
299 send Mysqlx.Sql.StmtExecute {
300 stmt: "select 2.1"
301 }
302
303 send Mysqlx.Sql.StmtExecute {
304 stmt: "select 2.2"
305 }
306
307 send Mysqlx.Session.Close {
308 }
309
310 2.1
311 2.1
312 0 rows affected
313 2.2
314 2.2
315 0 rows affected
316 RUN recvok
317 Login OK
318 send Mysqlx.Session.Close {
319 }
320
321 RUN recvok
322 send Mysqlx.Sql.StmtExecute {
323 stmt: "select 3.1"
324 }
325
326 Mysqlx.Error {
327 severity: FATAL
328 code: 5000
329 msg: "Invalid message"
330 sql_state: "HY000"
331 }
332
333 connecting...
334 active session is now 'foo'
335 RUN set @secret = 12345
336
337 0 rows affected
338 send Mysqlx.Session.Close {
339 }
340
341 RUN recvok
342 Login OK
343 RUN select IF(@secret is NULL, 'OK', 'FAIL')
344 IF(@secret is NULL, 'OK', 'FAIL')
345 OK
346 0 rows affected
347 closing session foo
348 Mysqlx.Ok {
349 msg: "bye!"
350 }
351 switched to session default
352 connecting...
353 active session is now 'foobar'
354 RUN set global max_connections = 1234
355
356
357 0 rows affected
358 send Mysqlx.Session.Close {
359 }
360
361 RUN recvok
362 Login OK
363 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
364 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
365 OK
366 0 rows affected
367 RUN set @@global.max_connections = default
368
369 0 rows affected
370 closing session foobar
371 Mysqlx.Ok {
372 msg: "bye!"
373 }
374 switched to session default
375 connecting...
376 active session is now 'bar'
377 send Mysqlx.Expect.Open {
378 cond {
379 condition_key: 1
380 }
381 }
382
383 RUN recvok
384 send Mysqlx.Session.Close {
385 }
386
387 RUN recvok
388 Login OK
389 send Mysqlx.Expect.Close {
390 }
391
392 Got expected error:
393 Mysqlx.Error {
394 severity: ERROR
395 code: 5158
396 msg: "Expect block currently not open"
397 sql_state: "HY000"
398 }
399
400 closing session bar
401 Mysqlx.Ok {
402 msg: "bye!"
403 }
404 ok
405
406 ## 2.a
407 #
408
409 Session reset single frame (Session_reset_empty)
410 ================================================
411 Sending 39 bytes raw data...
412 2.1
413 2.1
414 0 rows affected
415 Mysqlx.Ok {
416 }
417
418 Mysqlx.Error {
419 severity: FATAL
420 code: 5000
421 msg: "Invalid message"
422 sql_state: "HY000"
423 }
424
425 ok
426
427 ## 2.b
428 #
429
430 Session reset single frame (Session_reset)
431 ==========================================
432 Sending 41 bytes raw data...
433 2.1
434 2.1
435 0 rows affected
436 Mysqlx.Ok {
437 }
438
439 Mysqlx.Error {
440 severity: FATAL
441 code: 5000
442 msg: "Invalid message"
443 sql_state: "HY000"
444 }
445
446 ok
447
448 ## 2.c
449 #
450
451 Session reset single frame (Session_close)
452 ==========================================
453 Sending 39 bytes raw data...
454 2.1
455 2.1
456 0 rows affected
457 Mysqlx.Ok {
458 }
459
460 Mysqlx.Error {
461 severity: FATAL
462 code: 5000
463 msg: "Invalid message"
464 sql_state: "HY000"
465 }
466
467 ok
468
469 ## 3.a
470 #
471
472 Session reset prepared stmt (Session_reset_empty)
473 =================================================
474 send Mysqlx.Prepare.Prepare {
475 stmt_id: 2
476 stmt {
477 type: STMT
478 stmt_execute {
479 stmt: "select 2"
480 }
481 }
482 }
483
484 RUN recvok
485 send Mysqlx.Cursor.Open {
486 cursor_id: 3
487 stmt {
488 type: PREPARE_EXECUTE
489 prepare_execute {
490 stmt_id: 2
491 }
492 }
493 }
494
495 2
496 command ok
497 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
498 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
499 send Mysqlx.Session.Reset {
500 }
501
502 RUN recvok
503 Login OK
504 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
505 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
506 send Mysqlx.Prepare.Execute {
507 stmt_id: 2
508 }
509
510 Got expected error: Statement with ID=2 was not prepared (code 5110)
511 send Mysqlx.Cursor.Fetch {
512 cursor_id: 3
513 }
514
515 Got expected error: Cursor with ID=3 was not opened. (code 5111)
516 Mysqlx.Ok {
517 msg: "bye!"
518 }
519
520 ## 3.b
521 #
522
523 Session reset prepared stmt (Session_reset)
524 ===========================================
525 send Mysqlx.Prepare.Prepare {
526 stmt_id: 2
527 stmt {
528 type: STMT
529 stmt_execute {
530 stmt: "select 2"
531 }
532 }
533 }
534
535 RUN recvok
536 send Mysqlx.Cursor.Open {
537 cursor_id: 3
538 stmt {
539 type: PREPARE_EXECUTE
540 prepare_execute {
541 stmt_id: 2
542 }
543 }
544 }
545
546 2
547 command ok
548 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
549 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
550 send Mysqlx.Session.Reset {
551 keep_open: false
552 }
553
554 RUN recvok
555 Login OK
556 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
557 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
558 send Mysqlx.Prepare.Execute {
559 stmt_id: 2
560 }
561
562 Got expected error: Statement with ID=2 was not prepared (code 5110)
563 send Mysqlx.Cursor.Fetch {
564 cursor_id: 3
565 }
566
567 Got expected error: Cursor with ID=3 was not opened. (code 5111)
568 Mysqlx.Ok {
569 msg: "bye!"
570 }
571
572 ## 3.c
573 #
574
575 Session reset prepared stmt (Session_close)
576 ===========================================
577 send Mysqlx.Prepare.Prepare {
578 stmt_id: 2
579 stmt {
580 type: STMT
581 stmt_execute {
582 stmt: "select 2"
583 }
584 }
585 }
586
587 RUN recvok
588 send Mysqlx.Cursor.Open {
589 cursor_id: 3
590 stmt {
591 type: PREPARE_EXECUTE
592 prepare_execute {
593 stmt_id: 2
594 }
595 }
596 }
597
598 2
599 command ok
600 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
601 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
602 send Mysqlx.Session.Close {
603 }
604
605 RUN recvok
606 Login OK
607 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
608 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
609 send Mysqlx.Prepare.Execute {
610 stmt_id: 2
611 }
612
613 Got expected error: Statement with ID=2 was not prepared (code 5110)
614 send Mysqlx.Cursor.Fetch {
615 cursor_id: 3
616 }
617
618 Got expected error: Cursor with ID=3 was not opened. (code 5111)
619 Mysqlx.Ok {
620 msg: "bye!"
621 }
622
623 ## B. Execute the Session reset with "deflate" compression enabled
624 #
625 ## 1. Execute Reset using basic scenarios
626 # a. verify that reset without args removes current session
627 # b. verify that reset with keep_open=false removes current session
628 # c. verify that close removes current session
629 ## 2. Execute Reset with pipelined stmt-execute
630 # a. verify that reset without args removes current session
631 # b. verify that reset with keep_open=false removes current session
632 # c. verify that close removes current session
633 ## 3. Execute Reset and check that prepared-stmts are removed
634 # a. verify that reset without args removes current session and prepared-statemtents
635 # b. verify that reset with keep_open=false removes current session and prepared-statemtents
636 # c. verify that close removes current session and prepared-statemtents
637
638 ## 1.a
639 #
640
641 Session reset (Session_reset_empty)
642 ===================================
643 send Mysqlx.Session.Reset {
644 }
645
646 RUN recvok
647 Login OK
648 send Mysqlx.Sql.StmtExecute {
649 stmt: "select 1.1"
650 }
651
652 1.1
653 1.1
654 0 rows affected
655 send Mysqlx.Sql.StmtExecute {
656 stmt: "select 2.1"
657 }
658
659 send Mysqlx.Sql.StmtExecute {
660 stmt: "select 2.2"
661 }
662
663 send Mysqlx.Session.Reset {
664 }
665
666 2.1
667 2.1
668 0 rows affected
669 2.2
670 2.2
671 0 rows affected
672 RUN recvok
673 Login OK
674 send Mysqlx.Session.Reset {
675 }
676
677 RUN recvok
678 send Mysqlx.Sql.StmtExecute {
679 stmt: "select 3.1"
680 }
681
682 Mysqlx.Error {
683 severity: FATAL
684 code: 5000
685 msg: "Invalid message"
686 sql_state: "HY000"
687 }
688
689 connecting...
690 active session is now 'foo'
691 RUN set @secret = 12345
692
693 0 rows affected
694 send Mysqlx.Session.Reset {
695 }
696
697 RUN recvok
698 Login OK
699 RUN select IF(@secret is NULL, 'OK', 'FAIL')
700 IF(@secret is NULL, 'OK', 'FAIL')
701 OK
702 0 rows affected
703 closing session foo
704 Mysqlx.Ok {
705 msg: "bye!"
706 }
707 switched to session default
708 connecting...
709 active session is now 'foobar'
710 RUN set global max_connections = 1234
711
712
713 0 rows affected
714 send Mysqlx.Session.Reset {
715 }
716
717 RUN recvok
718 Login OK
719 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
720 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
721 OK
722 0 rows affected
723 RUN set @@global.max_connections = default
724
725 0 rows affected
726 closing session foobar
727 Mysqlx.Ok {
728 msg: "bye!"
729 }
730 switched to session default
731 connecting...
732 active session is now 'bar'
733 send Mysqlx.Expect.Open {
734 cond {
735 condition_key: 1
736 }
737 }
738
739 RUN recvok
740 send Mysqlx.Session.Reset {
741 }
742
743 RUN recvok
744 Login OK
745 send Mysqlx.Expect.Close {
746 }
747
748 Got expected error:
749 Mysqlx.Error {
750 severity: ERROR
751 code: 5158
752 msg: "Expect block currently not open"
753 sql_state: "HY000"
754 }
755
756 closing session bar
757 Mysqlx.Ok {
758 msg: "bye!"
759 }
760 ok
761
762 ## 1.b
763 #
764
765 Session reset (Session_reset)
766 =============================
767 send Mysqlx.Session.Reset {
768 keep_open: false
769 }
770
771 RUN recvok
772 Login OK
773 send Mysqlx.Sql.StmtExecute {
774 stmt: "select 1.1"
775 }
776
777 1.1
778 1.1
779 0 rows affected
780 send Mysqlx.Sql.StmtExecute {
781 stmt: "select 2.1"
782 }
783
784 send Mysqlx.Sql.StmtExecute {
785 stmt: "select 2.2"
786 }
787
788 send Mysqlx.Session.Reset {
789 keep_open: false
790 }
791
792 2.1
793 2.1
794 0 rows affected
795 2.2
796 2.2
797 0 rows affected
798 RUN recvok
799 Login OK
800 send Mysqlx.Session.Reset {
801 keep_open: false
802 }
803
804 RUN recvok
805 send Mysqlx.Sql.StmtExecute {
806 stmt: "select 3.1"
807 }
808
809 Mysqlx.Error {
810 severity: FATAL
811 code: 5000
812 msg: "Invalid message"
813 sql_state: "HY000"
814 }
815
816 connecting...
817 active session is now 'foo'
818 RUN set @secret = 12345
819
820 0 rows affected
821 send Mysqlx.Session.Reset {
822 keep_open: false
823 }
824
825 RUN recvok
826 Login OK
827 RUN select IF(@secret is NULL, 'OK', 'FAIL')
828 IF(@secret is NULL, 'OK', 'FAIL')
829 OK
830 0 rows affected
831 closing session foo
832 Mysqlx.Ok {
833 msg: "bye!"
834 }
835 switched to session default
836 connecting...
837 active session is now 'foobar'
838 RUN set global max_connections = 1234
839
840
841 0 rows affected
842 send Mysqlx.Session.Reset {
843 keep_open: false
844 }
845
846 RUN recvok
847 Login OK
848 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
849 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
850 OK
851 0 rows affected
852 RUN set @@global.max_connections = default
853
854 0 rows affected
855 closing session foobar
856 Mysqlx.Ok {
857 msg: "bye!"
858 }
859 switched to session default
860 connecting...
861 active session is now 'bar'
862 send Mysqlx.Expect.Open {
863 cond {
864 condition_key: 1
865 }
866 }
867
868 RUN recvok
869 send Mysqlx.Session.Reset {
870 keep_open: false
871 }
872
873 RUN recvok
874 Login OK
875 send Mysqlx.Expect.Close {
876 }
877
878 Got expected error:
879 Mysqlx.Error {
880 severity: ERROR
881 code: 5158
882 msg: "Expect block currently not open"
883 sql_state: "HY000"
884 }
885
886 closing session bar
887 Mysqlx.Ok {
888 msg: "bye!"
889 }
890 ok
891
892 ## 1.c
893 #
894
895 Session reset (Session_close)
896 =============================
897 send Mysqlx.Session.Close {
898 }
899
900 RUN recvok
901 Login OK
902 send Mysqlx.Sql.StmtExecute {
903 stmt: "select 1.1"
904 }
905
906 1.1
907 1.1
908 0 rows affected
909 send Mysqlx.Sql.StmtExecute {
910 stmt: "select 2.1"
911 }
912
913 send Mysqlx.Sql.StmtExecute {
914 stmt: "select 2.2"
915 }
916
917 send Mysqlx.Session.Close {
918 }
919
920 2.1
921 2.1
922 0 rows affected
923 2.2
924 2.2
925 0 rows affected
926 RUN recvok
927 Login OK
928 send Mysqlx.Session.Close {
929 }
930
931 RUN recvok
932 send Mysqlx.Sql.StmtExecute {
933 stmt: "select 3.1"
934 }
935
936 Mysqlx.Error {
937 severity: FATAL
938 code: 5000
939 msg: "Invalid message"
940 sql_state: "HY000"
941 }
942
943 connecting...
944 active session is now 'foo'
945 RUN set @secret = 12345
946
947 0 rows affected
948 send Mysqlx.Session.Close {
949 }
950
951 RUN recvok
952 Login OK
953 RUN select IF(@secret is NULL, 'OK', 'FAIL')
954 IF(@secret is NULL, 'OK', 'FAIL')
955 OK
956 0 rows affected
957 closing session foo
958 Mysqlx.Ok {
959 msg: "bye!"
960 }
961 switched to session default
962 connecting...
963 active session is now 'foobar'
964 RUN set global max_connections = 1234
965
966
967 0 rows affected
968 send Mysqlx.Session.Close {
969 }
970
971 RUN recvok
972 Login OK
973 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
974 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
975 OK
976 0 rows affected
977 RUN set @@global.max_connections = default
978
979 0 rows affected
980 closing session foobar
981 Mysqlx.Ok {
982 msg: "bye!"
983 }
984 switched to session default
985 connecting...
986 active session is now 'bar'
987 send Mysqlx.Expect.Open {
988 cond {
989 condition_key: 1
990 }
991 }
992
993 RUN recvok
994 send Mysqlx.Session.Close {
995 }
996
997 RUN recvok
998 Login OK
999 send Mysqlx.Expect.Close {
1000 }
1001
1002 Got expected error:
1003 Mysqlx.Error {
1004 severity: ERROR
1005 code: 5158
1006 msg: "Expect block currently not open"
1007 sql_state: "HY000"
1008 }
1009
1010 closing session bar
1011 Mysqlx.Ok {
1012 msg: "bye!"
1013 }
1014 ok
1015
1016 ## 2.a
1017 #
1018
1019 Session reset single frame (Session_reset_empty)
1020 ================================================
1021 Sending 39 bytes raw data...
1022 2.1
1023 2.1
1024 0 rows affected
1025 Mysqlx.Ok {
1026 }
1027
1028 Mysqlx.Error {
1029 severity: FATAL
1030 code: 5000
1031 msg: "Invalid message"
1032 sql_state: "HY000"
1033 }
1034
1035 ok
1036
1037 ## 2.b
1038 #
1039
1040 Session reset single frame (Session_reset)
1041 ==========================================
1042 Sending 41 bytes raw data...
1043 2.1
1044 2.1
1045 0 rows affected
1046 Mysqlx.Ok {
1047 }
1048
1049 Mysqlx.Error {
1050 severity: FATAL
1051 code: 5000
1052 msg: "Invalid message"
1053 sql_state: "HY000"
1054 }
1055
1056 ok
1057
1058 ## 2.c
1059 #
1060
1061 Session reset single frame (Session_close)
1062 ==========================================
1063 Sending 39 bytes raw data...
1064 2.1
1065 2.1
1066 0 rows affected
1067 Mysqlx.Ok {
1068 }
1069
1070 Mysqlx.Error {
1071 severity: FATAL
1072 code: 5000
1073 msg: "Invalid message"
1074 sql_state: "HY000"
1075 }
1076
1077 ok
1078
1079 ## 3.a
1080 #
1081
1082 Session reset prepared stmt (Session_reset_empty)
1083 =================================================
1084 send Mysqlx.Prepare.Prepare {
1085 stmt_id: 2
1086 stmt {
1087 type: STMT
1088 stmt_execute {
1089 stmt: "select 2"
1090 }
1091 }
1092 }
1093
1094 RUN recvok
1095 send Mysqlx.Cursor.Open {
1096 cursor_id: 3
1097 stmt {
1098 type: PREPARE_EXECUTE
1099 prepare_execute {
1100 stmt_id: 2
1101 }
1102 }
1103 }
1104
1105 2
1106 command ok
1107 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1108 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1109 send Mysqlx.Session.Reset {
1110 }
1111
1112 RUN recvok
1113 Login OK
1114 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1115 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1116 send Mysqlx.Prepare.Execute {
1117 stmt_id: 2
1118 }
1119
1120 Got expected error: Statement with ID=2 was not prepared (code 5110)
1121 send Mysqlx.Cursor.Fetch {
1122 cursor_id: 3
1123 }
1124
1125 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1126 Mysqlx.Ok {
1127 msg: "bye!"
1128 }
1129
1130 ## 3.b
1131 #
1132
1133 Session reset prepared stmt (Session_reset)
1134 ===========================================
1135 send Mysqlx.Prepare.Prepare {
1136 stmt_id: 2
1137 stmt {
1138 type: STMT
1139 stmt_execute {
1140 stmt: "select 2"
1141 }
1142 }
1143 }
1144
1145 RUN recvok
1146 send Mysqlx.Cursor.Open {
1147 cursor_id: 3
1148 stmt {
1149 type: PREPARE_EXECUTE
1150 prepare_execute {
1151 stmt_id: 2
1152 }
1153 }
1154 }
1155
1156 2
1157 command ok
1158 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1159 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1160 send Mysqlx.Session.Reset {
1161 keep_open: false
1162 }
1163
1164 RUN recvok
1165 Login OK
1166 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1167 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1168 send Mysqlx.Prepare.Execute {
1169 stmt_id: 2
1170 }
1171
1172 Got expected error: Statement with ID=2 was not prepared (code 5110)
1173 send Mysqlx.Cursor.Fetch {
1174 cursor_id: 3
1175 }
1176
1177 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1178 Mysqlx.Ok {
1179 msg: "bye!"
1180 }
1181
1182 ## 3.c
1183 #
1184
1185 Session reset prepared stmt (Session_close)
1186 ===========================================
1187 send Mysqlx.Prepare.Prepare {
1188 stmt_id: 2
1189 stmt {
1190 type: STMT
1191 stmt_execute {
1192 stmt: "select 2"
1193 }
1194 }
1195 }
1196
1197 RUN recvok
1198 send Mysqlx.Cursor.Open {
1199 cursor_id: 3
1200 stmt {
1201 type: PREPARE_EXECUTE
1202 prepare_execute {
1203 stmt_id: 2
1204 }
1205 }
1206 }
1207
1208 2
1209 command ok
1210 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1211 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1212 send Mysqlx.Session.Close {
1213 }
1214
1215 RUN recvok
1216 Login OK
1217 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1218 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1219 send Mysqlx.Prepare.Execute {
1220 stmt_id: 2
1221 }
1222
1223 Got expected error: Statement with ID=2 was not prepared (code 5110)
1224 send Mysqlx.Cursor.Fetch {
1225 cursor_id: 3
1226 }
1227
1228 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1229 Mysqlx.Ok {
1230 msg: "bye!"
1231 }
1232
1233 ## C. Execute the Session reset with "lz4" compression enabled
1234 #
1235 ## 1. Execute Reset using basic scenarios
1236 # a. verify that reset without args removes current session
1237 # b. verify that reset with keep_open=false removes current session
1238 # c. verify that close removes current session
1239 ## 2. Execute Reset with pipelined stmt-execute
1240 # a. verify that reset without args removes current session
1241 # b. verify that reset with keep_open=false removes current session
1242 # c. verify that close removes current session
1243 ## 3. Execute Reset and check that prepared-stmts are removed
1244 # a. verify that reset without args removes current session and prepared-statemtents
1245 # b. verify that reset with keep_open=false removes current session and prepared-statemtents
1246 # c. verify that close removes current session and prepared-statemtents
1247
1248 ## 1.a
1249 #
1250
1251 Session reset (Session_reset_empty)
1252 ===================================
1253 send Mysqlx.Session.Reset {
1254 }
1255
1256 RUN recvok
1257 Login OK
1258 send Mysqlx.Sql.StmtExecute {
1259 stmt: "select 1.1"
1260 }
1261
1262 1.1
1263 1.1
1264 0 rows affected
1265 send Mysqlx.Sql.StmtExecute {
1266 stmt: "select 2.1"
1267 }
1268
1269 send Mysqlx.Sql.StmtExecute {
1270 stmt: "select 2.2"
1271 }
1272
1273 send Mysqlx.Session.Reset {
1274 }
1275
1276 2.1
1277 2.1
1278 0 rows affected
1279 2.2
1280 2.2
1281 0 rows affected
1282 RUN recvok
1283 Login OK
1284 send Mysqlx.Session.Reset {
1285 }
1286
1287 RUN recvok
1288 send Mysqlx.Sql.StmtExecute {
1289 stmt: "select 3.1"
1290 }
1291
1292 Mysqlx.Error {
1293 severity: FATAL
1294 code: 5000
1295 msg: "Invalid message"
1296 sql_state: "HY000"
1297 }
1298
1299 connecting...
1300 active session is now 'foo'
1301 RUN set @secret = 12345
1302
1303 0 rows affected
1304 send Mysqlx.Session.Reset {
1305 }
1306
1307 RUN recvok
1308 Login OK
1309 RUN select IF(@secret is NULL, 'OK', 'FAIL')
1310 IF(@secret is NULL, 'OK', 'FAIL')
1311 OK
1312 0 rows affected
1313 closing session foo
1314 Mysqlx.Ok {
1315 msg: "bye!"
1316 }
1317 switched to session default
1318 connecting...
1319 active session is now 'foobar'
1320 RUN set global max_connections = 1234
1321
1322
1323 0 rows affected
1324 send Mysqlx.Session.Reset {
1325 }
1326
1327 RUN recvok
1328 Login OK
1329 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1330 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1331 OK
1332 0 rows affected
1333 RUN set @@global.max_connections = default
1334
1335 0 rows affected
1336 closing session foobar
1337 Mysqlx.Ok {
1338 msg: "bye!"
1339 }
1340 switched to session default
1341 connecting...
1342 active session is now 'bar'
1343 send Mysqlx.Expect.Open {
1344 cond {
1345 condition_key: 1
1346 }
1347 }
1348
1349 RUN recvok
1350 send Mysqlx.Session.Reset {
1351 }
1352
1353 RUN recvok
1354 Login OK
1355 send Mysqlx.Expect.Close {
1356 }
1357
1358 Got expected error:
1359 Mysqlx.Error {
1360 severity: ERROR
1361 code: 5158
1362 msg: "Expect block currently not open"
1363 sql_state: "HY000"
1364 }
1365
1366 closing session bar
1367 Mysqlx.Ok {
1368 msg: "bye!"
1369 }
1370 ok
1371
1372 ## 1.b
1373 #
1374
1375 Session reset (Session_reset)
1376 =============================
1377 send Mysqlx.Session.Reset {
1378 keep_open: false
1379 }
1380
1381 RUN recvok
1382 Login OK
1383 send Mysqlx.Sql.StmtExecute {
1384 stmt: "select 1.1"
1385 }
1386
1387 1.1
1388 1.1
1389 0 rows affected
1390 send Mysqlx.Sql.StmtExecute {
1391 stmt: "select 2.1"
1392 }
1393
1394 send Mysqlx.Sql.StmtExecute {
1395 stmt: "select 2.2"
1396 }
1397
1398 send Mysqlx.Session.Reset {
1399 keep_open: false
1400 }
1401
1402 2.1
1403 2.1
1404 0 rows affected
1405 2.2
1406 2.2
1407 0 rows affected
1408 RUN recvok
1409 Login OK
1410 send Mysqlx.Session.Reset {
1411 keep_open: false
1412 }
1413
1414 RUN recvok
1415 send Mysqlx.Sql.StmtExecute {
1416 stmt: "select 3.1"
1417 }
1418
1419 Mysqlx.Error {
1420 severity: FATAL
1421 code: 5000
1422 msg: "Invalid message"
1423 sql_state: "HY000"
1424 }
1425
1426 connecting...
1427 active session is now 'foo'
1428 RUN set @secret = 12345
1429
1430 0 rows affected
1431 send Mysqlx.Session.Reset {
1432 keep_open: false
1433 }
1434
1435 RUN recvok
1436 Login OK
1437 RUN select IF(@secret is NULL, 'OK', 'FAIL')
1438 IF(@secret is NULL, 'OK', 'FAIL')
1439 OK
1440 0 rows affected
1441 closing session foo
1442 Mysqlx.Ok {
1443 msg: "bye!"
1444 }
1445 switched to session default
1446 connecting...
1447 active session is now 'foobar'
1448 RUN set global max_connections = 1234
1449
1450
1451 0 rows affected
1452 send Mysqlx.Session.Reset {
1453 keep_open: false
1454 }
1455
1456 RUN recvok
1457 Login OK
1458 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1459 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1460 OK
1461 0 rows affected
1462 RUN set @@global.max_connections = default
1463
1464 0 rows affected
1465 closing session foobar
1466 Mysqlx.Ok {
1467 msg: "bye!"
1468 }
1469 switched to session default
1470 connecting...
1471 active session is now 'bar'
1472 send Mysqlx.Expect.Open {
1473 cond {
1474 condition_key: 1
1475 }
1476 }
1477
1478 RUN recvok
1479 send Mysqlx.Session.Reset {
1480 keep_open: false
1481 }
1482
1483 RUN recvok
1484 Login OK
1485 send Mysqlx.Expect.Close {
1486 }
1487
1488 Got expected error:
1489 Mysqlx.Error {
1490 severity: ERROR
1491 code: 5158
1492 msg: "Expect block currently not open"
1493 sql_state: "HY000"
1494 }
1495
1496 closing session bar
1497 Mysqlx.Ok {
1498 msg: "bye!"
1499 }
1500 ok
1501
1502 ## 1.c
1503 #
1504
1505 Session reset (Session_close)
1506 =============================
1507 send Mysqlx.Session.Close {
1508 }
1509
1510 RUN recvok
1511 Login OK
1512 send Mysqlx.Sql.StmtExecute {
1513 stmt: "select 1.1"
1514 }
1515
1516 1.1
1517 1.1
1518 0 rows affected
1519 send Mysqlx.Sql.StmtExecute {
1520 stmt: "select 2.1"
1521 }
1522
1523 send Mysqlx.Sql.StmtExecute {
1524 stmt: "select 2.2"
1525 }
1526
1527 send Mysqlx.Session.Close {
1528 }
1529
1530 2.1
1531 2.1
1532 0 rows affected
1533 2.2
1534 2.2
1535 0 rows affected
1536 RUN recvok
1537 Login OK
1538 send Mysqlx.Session.Close {
1539 }
1540
1541 RUN recvok
1542 send Mysqlx.Sql.StmtExecute {
1543 stmt: "select 3.1"
1544 }
1545
1546 Mysqlx.Error {
1547 severity: FATAL
1548 code: 5000
1549 msg: "Invalid message"
1550 sql_state: "HY000"
1551 }
1552
1553 connecting...
1554 active session is now 'foo'
1555 RUN set @secret = 12345
1556
1557 0 rows affected
1558 send Mysqlx.Session.Close {
1559 }
1560
1561 RUN recvok
1562 Login OK
1563 RUN select IF(@secret is NULL, 'OK', 'FAIL')
1564 IF(@secret is NULL, 'OK', 'FAIL')
1565 OK
1566 0 rows affected
1567 closing session foo
1568 Mysqlx.Ok {
1569 msg: "bye!"
1570 }
1571 switched to session default
1572 connecting...
1573 active session is now 'foobar'
1574 RUN set global max_connections = 1234
1575
1576
1577 0 rows affected
1578 send Mysqlx.Session.Close {
1579 }
1580
1581 RUN recvok
1582 Login OK
1583 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1584 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1585 OK
1586 0 rows affected
1587 RUN set @@global.max_connections = default
1588
1589 0 rows affected
1590 closing session foobar
1591 Mysqlx.Ok {
1592 msg: "bye!"
1593 }
1594 switched to session default
1595 connecting...
1596 active session is now 'bar'
1597 send Mysqlx.Expect.Open {
1598 cond {
1599 condition_key: 1
1600 }
1601 }
1602
1603 RUN recvok
1604 send Mysqlx.Session.Close {
1605 }
1606
1607 RUN recvok
1608 Login OK
1609 send Mysqlx.Expect.Close {
1610 }
1611
1612 Got expected error:
1613 Mysqlx.Error {
1614 severity: ERROR
1615 code: 5158
1616 msg: "Expect block currently not open"
1617 sql_state: "HY000"
1618 }
1619
1620 closing session bar
1621 Mysqlx.Ok {
1622 msg: "bye!"
1623 }
1624 ok
1625
1626 ## 2.a
1627 #
1628
1629 Session reset single frame (Session_reset_empty)
1630 ================================================
1631 Sending 39 bytes raw data...
1632 2.1
1633 2.1
1634 0 rows affected
1635 Mysqlx.Ok {
1636 }
1637
1638 Mysqlx.Error {
1639 severity: FATAL
1640 code: 5000
1641 msg: "Invalid message"
1642 sql_state: "HY000"
1643 }
1644
1645 ok
1646
1647 ## 2.b
1648 #
1649
1650 Session reset single frame (Session_reset)
1651 ==========================================
1652 Sending 41 bytes raw data...
1653 2.1
1654 2.1
1655 0 rows affected
1656 Mysqlx.Ok {
1657 }
1658
1659 Mysqlx.Error {
1660 severity: FATAL
1661 code: 5000
1662 msg: "Invalid message"
1663 sql_state: "HY000"
1664 }
1665
1666 ok
1667
1668 ## 2.c
1669 #
1670
1671 Session reset single frame (Session_close)
1672 ==========================================
1673 Sending 39 bytes raw data...
1674 2.1
1675 2.1
1676 0 rows affected
1677 Mysqlx.Ok {
1678 }
1679
1680 Mysqlx.Error {
1681 severity: FATAL
1682 code: 5000
1683 msg: "Invalid message"
1684 sql_state: "HY000"
1685 }
1686
1687 ok
1688
1689 ## 3.a
1690 #
1691
1692 Session reset prepared stmt (Session_reset_empty)
1693 =================================================
1694 send Mysqlx.Prepare.Prepare {
1695 stmt_id: 2
1696 stmt {
1697 type: STMT
1698 stmt_execute {
1699 stmt: "select 2"
1700 }
1701 }
1702 }
1703
1704 RUN recvok
1705 send Mysqlx.Cursor.Open {
1706 cursor_id: 3
1707 stmt {
1708 type: PREPARE_EXECUTE
1709 prepare_execute {
1710 stmt_id: 2
1711 }
1712 }
1713 }
1714
1715 2
1716 command ok
1717 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1718 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1719 send Mysqlx.Session.Reset {
1720 }
1721
1722 RUN recvok
1723 Login OK
1724 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1725 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1726 send Mysqlx.Prepare.Execute {
1727 stmt_id: 2
1728 }
1729
1730 Got expected error: Statement with ID=2 was not prepared (code 5110)
1731 send Mysqlx.Cursor.Fetch {
1732 cursor_id: 3
1733 }
1734
1735 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1736 Mysqlx.Ok {
1737 msg: "bye!"
1738 }
1739
1740 ## 3.b
1741 #
1742
1743 Session reset prepared stmt (Session_reset)
1744 ===========================================
1745 send Mysqlx.Prepare.Prepare {
1746 stmt_id: 2
1747 stmt {
1748 type: STMT
1749 stmt_execute {
1750 stmt: "select 2"
1751 }
1752 }
1753 }
1754
1755 RUN recvok
1756 send Mysqlx.Cursor.Open {
1757 cursor_id: 3
1758 stmt {
1759 type: PREPARE_EXECUTE
1760 prepare_execute {
1761 stmt_id: 2
1762 }
1763 }
1764 }
1765
1766 2
1767 command ok
1768 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1769 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1770 send Mysqlx.Session.Reset {
1771 keep_open: false
1772 }
1773
1774 RUN recvok
1775 Login OK
1776 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1777 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1778 send Mysqlx.Prepare.Execute {
1779 stmt_id: 2
1780 }
1781
1782 Got expected error: Statement with ID=2 was not prepared (code 5110)
1783 send Mysqlx.Cursor.Fetch {
1784 cursor_id: 3
1785 }
1786
1787 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1788 Mysqlx.Ok {
1789 msg: "bye!"
1790 }
1791
1792 ## 3.c
1793 #
1794
1795 Session reset prepared stmt (Session_close)
1796 ===========================================
1797 send Mysqlx.Prepare.Prepare {
1798 stmt_id: 2
1799 stmt {
1800 type: STMT
1801 stmt_execute {
1802 stmt: "select 2"
1803 }
1804 }
1805 }
1806
1807 RUN recvok
1808 send Mysqlx.Cursor.Open {
1809 cursor_id: 3
1810 stmt {
1811 type: PREPARE_EXECUTE
1812 prepare_execute {
1813 stmt_id: 2
1814 }
1815 }
1816 }
1817
1818 2
1819 command ok
1820 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1821 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
1822 send Mysqlx.Session.Close {
1823 }
1824
1825 RUN recvok
1826 Login OK
1827 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
1828 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
1829 send Mysqlx.Prepare.Execute {
1830 stmt_id: 2
1831 }
1832
1833 Got expected error: Statement with ID=2 was not prepared (code 5110)
1834 send Mysqlx.Cursor.Fetch {
1835 cursor_id: 3
1836 }
1837
1838 Got expected error: Cursor with ID=3 was not opened. (code 5111)
1839 Mysqlx.Ok {
1840 msg: "bye!"
1841 }
1842
1843 ## D. Execute the Session reset with "zstd" compression enabled
1844 #
1845 ## 1. Execute Reset using basic scenarios
1846 # a. verify that reset without args removes current session
1847 # b. verify that reset with keep_open=false removes current session
1848 # c. verify that close removes current session
1849 ## 2. Execute Reset with pipelined stmt-execute
1850 # a. verify that reset without args removes current session
1851 # b. verify that reset with keep_open=false removes current session
1852 # c. verify that close removes current session
1853 ## 3. Execute Reset and check that prepared-stmts are removed
1854 # a. verify that reset without args removes current session and prepared-statemtents
1855 # b. verify that reset with keep_open=false removes current session and prepared-statemtents
1856 # c. verify that close removes current session and prepared-statemtents
1857
1858 ## 1.a
1859 #
1860
1861 Session reset (Session_reset_empty)
1862 ===================================
1863 send Mysqlx.Session.Reset {
1864 }
1865
1866 RUN recvok
1867 Login OK
1868 send Mysqlx.Sql.StmtExecute {
1869 stmt: "select 1.1"
1870 }
1871
1872 1.1
1873 1.1
1874 0 rows affected
1875 send Mysqlx.Sql.StmtExecute {
1876 stmt: "select 2.1"
1877 }
1878
1879 send Mysqlx.Sql.StmtExecute {
1880 stmt: "select 2.2"
1881 }
1882
1883 send Mysqlx.Session.Reset {
1884 }
1885
1886 2.1
1887 2.1
1888 0 rows affected
1889 2.2
1890 2.2
1891 0 rows affected
1892 RUN recvok
1893 Login OK
1894 send Mysqlx.Session.Reset {
1895 }
1896
1897 RUN recvok
1898 send Mysqlx.Sql.StmtExecute {
1899 stmt: "select 3.1"
1900 }
1901
1902 Mysqlx.Error {
1903 severity: FATAL
1904 code: 5000
1905 msg: "Invalid message"
1906 sql_state: "HY000"
1907 }
1908
1909 connecting...
1910 active session is now 'foo'
1911 RUN set @secret = 12345
1912
1913 0 rows affected
1914 send Mysqlx.Session.Reset {
1915 }
1916
1917 RUN recvok
1918 Login OK
1919 RUN select IF(@secret is NULL, 'OK', 'FAIL')
1920 IF(@secret is NULL, 'OK', 'FAIL')
1921 OK
1922 0 rows affected
1923 closing session foo
1924 Mysqlx.Ok {
1925 msg: "bye!"
1926 }
1927 switched to session default
1928 connecting...
1929 active session is now 'foobar'
1930 RUN set global max_connections = 1234
1931
1932
1933 0 rows affected
1934 send Mysqlx.Session.Reset {
1935 }
1936
1937 RUN recvok
1938 Login OK
1939 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1940 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
1941 OK
1942 0 rows affected
1943 RUN set @@global.max_connections = default
1944
1945 0 rows affected
1946 closing session foobar
1947 Mysqlx.Ok {
1948 msg: "bye!"
1949 }
1950 switched to session default
1951 connecting...
1952 active session is now 'bar'
1953 send Mysqlx.Expect.Open {
1954 cond {
1955 condition_key: 1
1956 }
1957 }
1958
1959 RUN recvok
1960 send Mysqlx.Session.Reset {
1961 }
1962
1963 RUN recvok
1964 Login OK
1965 send Mysqlx.Expect.Close {
1966 }
1967
1968 Got expected error:
1969 Mysqlx.Error {
1970 severity: ERROR
1971 code: 5158
1972 msg: "Expect block currently not open"
1973 sql_state: "HY000"
1974 }
1975
1976 closing session bar
1977 Mysqlx.Ok {
1978 msg: "bye!"
1979 }
1980 ok
1981
1982 ## 1.b
1983 #
1984
1985 Session reset (Session_reset)
1986 =============================
1987 send Mysqlx.Session.Reset {
1988 keep_open: false
1989 }
1990
1991 RUN recvok
1992 Login OK
1993 send Mysqlx.Sql.StmtExecute {
1994 stmt: "select 1.1"
1995 }
1996
1997 1.1
1998 1.1
1999 0 rows affected
2000 send Mysqlx.Sql.StmtExecute {
2001 stmt: "select 2.1"
2002 }
2003
2004 send Mysqlx.Sql.StmtExecute {
2005 stmt: "select 2.2"
2006 }
2007
2008 send Mysqlx.Session.Reset {
2009 keep_open: false
2010 }
2011
2012 2.1
2013 2.1
2014 0 rows affected
2015 2.2
2016 2.2
2017 0 rows affected
2018 RUN recvok
2019 Login OK
2020 send Mysqlx.Session.Reset {
2021 keep_open: false
2022 }
2023
2024 RUN recvok
2025 send Mysqlx.Sql.StmtExecute {
2026 stmt: "select 3.1"
2027 }
2028
2029 Mysqlx.Error {
2030 severity: FATAL
2031 code: 5000
2032 msg: "Invalid message"
2033 sql_state: "HY000"
2034 }
2035
2036 connecting...
2037 active session is now 'foo'
2038 RUN set @secret = 12345
2039
2040 0 rows affected
2041 send Mysqlx.Session.Reset {
2042 keep_open: false
2043 }
2044
2045 RUN recvok
2046 Login OK
2047 RUN select IF(@secret is NULL, 'OK', 'FAIL')
2048 IF(@secret is NULL, 'OK', 'FAIL')
2049 OK
2050 0 rows affected
2051 closing session foo
2052 Mysqlx.Ok {
2053 msg: "bye!"
2054 }
2055 switched to session default
2056 connecting...
2057 active session is now 'foobar'
2058 RUN set global max_connections = 1234
2059
2060
2061 0 rows affected
2062 send Mysqlx.Session.Reset {
2063 keep_open: false
2064 }
2065
2066 RUN recvok
2067 Login OK
2068 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
2069 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
2070 OK
2071 0 rows affected
2072 RUN set @@global.max_connections = default
2073
2074 0 rows affected
2075 closing session foobar
2076 Mysqlx.Ok {
2077 msg: "bye!"
2078 }
2079 switched to session default
2080 connecting...
2081 active session is now 'bar'
2082 send Mysqlx.Expect.Open {
2083 cond {
2084 condition_key: 1
2085 }
2086 }
2087
2088 RUN recvok
2089 send Mysqlx.Session.Reset {
2090 keep_open: false
2091 }
2092
2093 RUN recvok
2094 Login OK
2095 send Mysqlx.Expect.Close {
2096 }
2097
2098 Got expected error:
2099 Mysqlx.Error {
2100 severity: ERROR
2101 code: 5158
2102 msg: "Expect block currently not open"
2103 sql_state: "HY000"
2104 }
2105
2106 closing session bar
2107 Mysqlx.Ok {
2108 msg: "bye!"
2109 }
2110 ok
2111
2112 ## 1.c
2113 #
2114
2115 Session reset (Session_close)
2116 =============================
2117 send Mysqlx.Session.Close {
2118 }
2119
2120 RUN recvok
2121 Login OK
2122 send Mysqlx.Sql.StmtExecute {
2123 stmt: "select 1.1"
2124 }
2125
2126 1.1
2127 1.1
2128 0 rows affected
2129 send Mysqlx.Sql.StmtExecute {
2130 stmt: "select 2.1"
2131 }
2132
2133 send Mysqlx.Sql.StmtExecute {
2134 stmt: "select 2.2"
2135 }
2136
2137 send Mysqlx.Session.Close {
2138 }
2139
2140 2.1
2141 2.1
2142 0 rows affected
2143 2.2
2144 2.2
2145 0 rows affected
2146 RUN recvok
2147 Login OK
2148 send Mysqlx.Session.Close {
2149 }
2150
2151 RUN recvok
2152 send Mysqlx.Sql.StmtExecute {
2153 stmt: "select 3.1"
2154 }
2155
2156 Mysqlx.Error {
2157 severity: FATAL
2158 code: 5000
2159 msg: "Invalid message"
2160 sql_state: "HY000"
2161 }
2162
2163 connecting...
2164 active session is now 'foo'
2165 RUN set @secret = 12345
2166
2167 0 rows affected
2168 send Mysqlx.Session.Close {
2169 }
2170
2171 RUN recvok
2172 Login OK
2173 RUN select IF(@secret is NULL, 'OK', 'FAIL')
2174 IF(@secret is NULL, 'OK', 'FAIL')
2175 OK
2176 0 rows affected
2177 closing session foo
2178 Mysqlx.Ok {
2179 msg: "bye!"
2180 }
2181 switched to session default
2182 connecting...
2183 active session is now 'foobar'
2184 RUN set global max_connections = 1234
2185
2186
2187 0 rows affected
2188 send Mysqlx.Session.Close {
2189 }
2190
2191 RUN recvok
2192 Login OK
2193 RUN select IF(@@global.max_connections = 1234, 'OK', 'FAIL')
2194 IF(@@global.max_connections = 1234, 'OK', 'FAIL')
2195 OK
2196 0 rows affected
2197 RUN set @@global.max_connections = default
2198
2199 0 rows affected
2200 closing session foobar
2201 Mysqlx.Ok {
2202 msg: "bye!"
2203 }
2204 switched to session default
2205 connecting...
2206 active session is now 'bar'
2207 send Mysqlx.Expect.Open {
2208 cond {
2209 condition_key: 1
2210 }
2211 }
2212
2213 RUN recvok
2214 send Mysqlx.Session.Close {
2215 }
2216
2217 RUN recvok
2218 Login OK
2219 send Mysqlx.Expect.Close {
2220 }
2221
2222 Got expected error:
2223 Mysqlx.Error {
2224 severity: ERROR
2225 code: 5158
2226 msg: "Expect block currently not open"
2227 sql_state: "HY000"
2228 }
2229
2230 closing session bar
2231 Mysqlx.Ok {
2232 msg: "bye!"
2233 }
2234 ok
2235
2236 ## 2.a
2237 #
2238
2239 Session reset single frame (Session_reset_empty)
2240 ================================================
2241 Sending 39 bytes raw data...
2242 2.1
2243 2.1
2244 0 rows affected
2245 Mysqlx.Ok {
2246 }
2247
2248 Mysqlx.Error {
2249 severity: FATAL
2250 code: 5000
2251 msg: "Invalid message"
2252 sql_state: "HY000"
2253 }
2254
2255 ok
2256
2257 ## 2.b
2258 #
2259
2260 Session reset single frame (Session_reset)
2261 ==========================================
2262 Sending 41 bytes raw data...
2263 2.1
2264 2.1
2265 0 rows affected
2266 Mysqlx.Ok {
2267 }
2268
2269 Mysqlx.Error {
2270 severity: FATAL
2271 code: 5000
2272 msg: "Invalid message"
2273 sql_state: "HY000"
2274 }
2275
2276 ok
2277
2278 ## 2.c
2279 #
2280
2281 Session reset single frame (Session_close)
2282 ==========================================
2283 Sending 39 bytes raw data...
2284 2.1
2285 2.1
2286 0 rows affected
2287 Mysqlx.Ok {
2288 }
2289
2290 Mysqlx.Error {
2291 severity: FATAL
2292 code: 5000
2293 msg: "Invalid message"
2294 sql_state: "HY000"
2295 }
2296
2297 ok
2298
2299 ## 3.a
2300 #
2301
2302 Session reset prepared stmt (Session_reset_empty)
2303 =================================================
2304 send Mysqlx.Prepare.Prepare {
2305 stmt_id: 2
2306 stmt {
2307 type: STMT
2308 stmt_execute {
2309 stmt: "select 2"
2310 }
2311 }
2312 }
2313
2314 RUN recvok
2315 send Mysqlx.Cursor.Open {
2316 cursor_id: 3
2317 stmt {
2318 type: PREPARE_EXECUTE
2319 prepare_execute {
2320 stmt_id: 2
2321 }
2322 }
2323 }
2324
2325 2
2326 command ok
2327 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2328 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
2329 send Mysqlx.Session.Reset {
2330 }
2331
2332 RUN recvok
2333 Login OK
2334 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2335 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
2336 send Mysqlx.Prepare.Execute {
2337 stmt_id: 2
2338 }
2339
2340 Got expected error: Statement with ID=2 was not prepared (code 5110)
2341 send Mysqlx.Cursor.Fetch {
2342 cursor_id: 3
2343 }
2344
2345 Got expected error: Cursor with ID=3 was not opened. (code 5111)
2346 Mysqlx.Ok {
2347 msg: "bye!"
2348 }
2349
2350 ## 3.b
2351 #
2352
2353 Session reset prepared stmt (Session_reset)
2354 ===========================================
2355 send Mysqlx.Prepare.Prepare {
2356 stmt_id: 2
2357 stmt {
2358 type: STMT
2359 stmt_execute {
2360 stmt: "select 2"
2361 }
2362 }
2363 }
2364
2365 RUN recvok
2366 send Mysqlx.Cursor.Open {
2367 cursor_id: 3
2368 stmt {
2369 type: PREPARE_EXECUTE
2370 prepare_execute {
2371 stmt_id: 2
2372 }
2373 }
2374 }
2375
2376 2
2377 command ok
2378 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2379 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
2380 send Mysqlx.Session.Reset {
2381 keep_open: false
2382 }
2383
2384 RUN recvok
2385 Login OK
2386 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2387 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
2388 send Mysqlx.Prepare.Execute {
2389 stmt_id: 2
2390 }
2391
2392 Got expected error: Statement with ID=2 was not prepared (code 5110)
2393 send Mysqlx.Cursor.Fetch {
2394 cursor_id: 3
2395 }
2396
2397 Got expected error: Cursor with ID=3 was not opened. (code 5111)
2398 Mysqlx.Ok {
2399 msg: "bye!"
2400 }
2401
2402 ## 3.c
2403 #
2404
2405 Session reset prepared stmt (Session_close)
2406 ===========================================
2407 send Mysqlx.Prepare.Prepare {
2408 stmt_id: 2
2409 stmt {
2410 type: STMT
2411 stmt_execute {
2412 stmt: "select 2"
2413 }
2414 }
2415 }
2416
2417 RUN recvok
2418 send Mysqlx.Cursor.Open {
2419 cursor_id: 3
2420 stmt {
2421 type: PREPARE_EXECUTE
2422 prepare_execute {
2423 stmt_id: 2
2424 }
2425 }
2426 }
2427
2428 2
2429 command ok
2430 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2431 Verify [Status variable "Prepared_stmt_count" needs to have a value of 1]
2432 send Mysqlx.Session.Close {
2433 }
2434
2435 RUN recvok
2436 Login OK
2437 RUN SHOW STATUS LIKE 'Prepared_stmt_count';
2438 Verify [Status variable "Prepared_stmt_count" needs to have a value of 0]
2439 send Mysqlx.Prepare.Execute {
2440 stmt_id: 2
2441 }
2442
2443 Got expected error: Statement with ID=2 was not prepared (code 5110)
2444 send Mysqlx.Cursor.Fetch {
2445 cursor_id: 3
2446 }
2447
2448 Got expected error: Cursor with ID=3 was not opened. (code 5111)
2449 Mysqlx.Ok {
2450 msg: "bye!"
2451 }