[MXS-1296] Lowercase start transaction is not detected Created: 2017-06-23  Updated: 2020-08-25  Resolved: 2017-06-27

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.1.3
Fix Version/s: 2.1.4

Type: Bug Priority: Blocker
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None


 Description   

Executing a start transaction statement with all characters in lowercase fails to be detected as the starting edge of a transaction.

This is caused by the following case-sensitive check for the character T in trxboundaryprser.hh on line 773:

            case 's':
            case 'S':
                if (is_next_alpha('E'))
                {
                    if (is_next_alpha('S', 2))
                    {
                        token = expect_token(TBP_EXPECT_TOKEN("SESSION"), TK_SESSION);
                    }
                    else
                    {
                        token = expect_token(TBP_EXPECT_TOKEN("SET"), TK_SET);
                    }
                }
                else if (is_next_alpha('N'))
                {
                    token = expect_token(TBP_EXPECT_TOKEN("SNAPSHOT"), TK_SNAPSHOT);
                }
                else if (is_next_char('T'))
                {
                    token = expect_token(TBP_EXPECT_TOKEN("START"), TK_START);
                }
                break;

As all tokens can be lowercase, the use of the is_next_char function should be replaced with is_next_alpha.


Generated at Thu Feb 08 04:05:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.