Documentation Home
MySQL Internals Manual


MySQL Internals Manual  /  ...  /  Variation of the Protocol Option

26.5.2 Variation of the Protocol Option

It is usual to run tests with and without the mysql-test-run.pl startup option "--ps-protocol". And there are also attempts of System QA to run the other protocols.

  • Effect of the "--ps-protocol" option: mysqltest will run as many SQL statements as possible as prepared statements.

  • Effect of the "--sp-protocol"/"--cursor-protocol"/"--view-protocol" options: As far as I know, mysqltest takes many statements and transforms them into a statement sequence checking the corresponding feature (stored procedures, cursors, or views).

We have a lot of tests running very similar and extremely simple SQL just for the creation of a situation to be tested, check of table content, etc. So it can be assumed that the n'th test running again simple statements does not improve the coverage.

Conclusion:

If your test contains

  • Simple statements: Prevent the non valuable runs for "protocols".

  • Storage engine variations: Prevent the protocol runs for all except one storage engine (my take would be MyISAM).

  • "Unique" and complex statements:

    • ps-protocol statements = all SQL

    • sp-protocol statements = DML

    • view/cursor-protocols statements = SELECTs

Do not prevent the protocol runs.

Another problem around runs with such protocols is that there are cases where we get different protocol content.

Example:

Script:

SELECT * FROM processlist ...

Protocol content if running without any "--*-protocol":

ID USER ... COMMAND ... STATE INFO
1 root ... Query ... preparing SELECT * FROM processlist ...

Protocol content if running with "--ps-protocol":

ID USER ... COMMAND ... STATE INFO
1 root ... Execute ... preparing SELECT * FROM processlist ...

So please check whether every new test gives the same result with every protocol but at least with "--ps-protocol". If not, do something of the following:

  • Exclude some protocol variants from execution.

  • Disable the the use of the protocols for problematic statements.

  • Write protocol variant specific tests.

Example solution (code within the top level scripts):

# The file with expected results fits only to a run without
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL
          + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
{
   --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
}
--source include/<whatever>.inc

or

# The file with expected results fits only to a run with "--ps-protocol".
if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
         OR $PS_PROTOCOL = 0`)
{
   --skip Test requires: ps-protocol enabled, other protocols disabled
}
--source include/<whatever>.inc

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.