Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replication: Make ServerVersion a proper string #930

Merged

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