Documentation Home
MySQL Internals Manual


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
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.