[KYUUBI #1442] Fix encode MySQLHandshakePacket UT

### _Why are the changes needed?_

Previous the UT depends on `KYUUBI_VERSION`, so bump version casue it to fail.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1442 from pan3793/fix-mysql-codec.

Closes #1442

ad3901fa [Cheng Pan] Address comments
d17b5b57 [Cheng Pan] Fix encode MySQLHandshakePacket UT

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: fwang12 <fwang12@ebay.com>
This commit is contained in:
Cheng Pan 2021-11-24 12:12:10 +08:00 committed by Fei Wang
parent 2df3b4e27b
commit 7784ded98b

View File

@ -31,15 +31,15 @@ class MySQLAuthPacketSuite extends KyuubiFunSuite with MySQLCodecHelper {
}
test("encode MySQLHandshakePacket") {
val packet = MySQLHandshakePacket(2, authPluginData)
val packet = new MySQLHandshakePacket(2, authPluginData) {
override def serverVersion: String = "dummy"
}
val expected = decodeHex(
"""0a 35 2e 37 2e 32 32 2d 4b 79 75 75 62 69 2d 53
|65 72 76 65 72 20 31 2e 34 2e 30 2d 53 4e 41 50
|53 48 4f 54 00 02 00 00 00 77 37 34 35 45 51 55
|65 00 4f b7 2d 02 00 08 00 15 00 00 00 00 00 00
|00 00 00 00 69 44 57 32 44 44 33 4e 6d 36 69 74
|00 6d 79 73 71 6c 5f 6e 61 74 69 76 65 5f 70 61
|73 73 77 6f 72 64 00
"""0a 64 75 6d 6d 79 00 02 00 00 00 77 37 34 35 45
|51 55 65 00 4f b7 2d 02 00 08 00 15 00 00 00 00
|00 00 00 00 00 00 69 44 57 32 44 44 33 4e 6d 36
|69 74 00 6d 79 73 71 6c 5f 6e 61 74 69 76 65 5f
|70 61 73 73 77 6f 72 64 00
|""".stripMargin)
verifyEncode(expected, packet)
}