Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 1.2Mb


MySQL Internals Manual  /  ...  /  Better Protocol Example

26.2.5 Better Protocol Example

Good script with message about switching the connection:

SET @aux = 1;
SELECT @aux AS "content of @aux is";
--echo # Establish session con1 (user=root)
connect (con1,localhost,root,,,,);
SELECT @aux AS "content of @aux is";

Protocol of good script:

SET @aux = 1;
SELECT @aux AS "content of @aux is";
content of @aux is
1   
# Establish session con1 (user=root)
SELECT @aux AS "content of @aux is";
content of @aux is
NULL

This is what the protocol looks like without the comment. The output becomes less clear because there is no indication that the connection has been changed.

SET @aux = 1;
SELECT @aux AS "content of @aux is";
content of @aux is
1   
SELECT @aux AS "content of @aux is";
content of @aux is
NULL

User Comments
Sign Up Login You must be logged in to post a comment.