Skip to content

Conversation

@dveeden
Copy link
Collaborator

@dveeden dveeden commented Oct 26, 2024

The ServerVersion is a slice of 50 bytes. If the ServerVersion was "9.1.0" then the rest of they bytes would be 0x0.

This caused the printout of the FormatDescriptionEvent in go-mysqlbinlog to look weird.

Before:

=== FormatDescriptionEvent ===
Date: 2024-10-24 14:42:04
Log position: 127
Event size: 123
Version: 4
Server version: 9.1.0^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
Checksum algorithm: 1

After:

=== FormatDescriptionEvent ===
Date: 2024-10-24 14:42:04
Log position: 127
Event size: 123
Version: 4
Server version: 9.1.0
Checksum algorithm: 1

The ServerVersion is a slice of 50 bytes. If the ServerVersion was
"9.1.0" then the rest of they bytes would be 0x0.

This caused the printout of the FormatDescriptionEvent in go-mysqlbinlog
to look weird.

Before:

```
=== FormatDescriptionEvent ===
Date: 2024-10-24 14:42:04
Log position: 127
Event size: 123
Version: 4
Server version: 9.1.0^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
Checksum algorithm: 1
```

After:

```
=== FormatDescriptionEvent ===
Date: 2024-10-24 14:42:04
Log position: 127
Event size: 123
Version: 4
Server version: 9.1.0
Checksum algorithm: 1
```
@lance6716 lance6716 merged commit 22158ba into go-mysql-org:master Oct 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants