-
-
Notifications
You must be signed in to change notification settings - Fork 238
dolthub/dolt#9887: Add BINLOG and mariadb-binlog support
#3279
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dc243ce
add mariadb-binlog.bats and fix test 1
elianddb e361bca
add binlog exec
elianddb 1552a92
add test and rowexec/binlog impl
elianddb dbd9dc4
fix go files
elianddb 569cd53
fix sys var set
elianddb 1748ecc
fix bitmask conv
elianddb a645e85
add ok res to binlog script tests
elianddb eea83d8
add ok res schema
elianddb b3fa40b
add syntax err
elianddb 57e9f89
amend binary
elianddb 5bef99b
add path finder
elianddb e4c3a2e
amend to use replica controller
elianddb 4dfe4e4
amend vitess ver.
elianddb 865c588
use binlogconsumer
elianddb 46654f2
rm binlog_queries
elianddb 98c91c9
amend to provider suffix and add converter func tests
elianddb a5bc4e8
amend init global sys vars
elianddb d8c9f1e
fix sys var getter
elianddb 16a53c3
[ga-format-pr] Run ./format_repo.sh to fix formatting
elianddb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // Copyright 2025 Dolthub, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package plan | ||
|
|
||
| import ( | ||
| "github.com/dolthub/go-mysql-server/sql" | ||
| "github.com/dolthub/go-mysql-server/sql/binlogreplication" | ||
| "github.com/dolthub/go-mysql-server/sql/types" | ||
| ) | ||
|
|
||
| // DynamicPrivilege_BinlogAdmin enables binary log control by means of the PURGE BINARY LOGS and BINLOG statements. | ||
| // https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_binlog-admin | ||
| const DynamicPrivilege_BinlogAdmin = "binlog_admin" | ||
|
|
||
| // Binlog replays binary log events, which record database changes in a binary format for efficiency. Tools like | ||
| // mysqldump, mysqlbinlog, and mariadb-binlog read these binary events from log files and output them as base64-encoded | ||
| // BINLOG statements for replay. | ||
| // | ||
| // The BINLOG statement execution is delegated to the BinlogConsumer. The base64-encoded event data is decoded | ||
| // and passed to the consumer's ProcessEvent method for processing. This allows integrators like Dolt to handle | ||
| // BINLOG statement execution using their binlog event processing infrastructure. | ||
| // | ||
| // See https://dev.mysql.com/doc/refman/8.4/en/binlog.html for the BINLOG statement specification. | ||
| type Binlog struct { | ||
| Base64Str string | ||
| Consumer binlogreplication.BinlogConsumer | ||
| } | ||
|
|
||
| var _ sql.Node = (*Binlog)(nil) | ||
| var _ BinlogConsumerCommand = (*Binlog)(nil) | ||
|
|
||
| // NewBinlog creates a new Binlog node. | ||
| func NewBinlog(base64Str string) *Binlog { | ||
| return &Binlog{ | ||
| Base64Str: base64Str, | ||
| } | ||
| } | ||
|
|
||
| // WithBinlogConsumer implements the BinlogConsumerCommand interface. | ||
| func (b *Binlog) WithBinlogConsumer(consumer binlogreplication.BinlogConsumer) sql.Node { | ||
| nc := *b | ||
| nc.Consumer = consumer | ||
| return &nc | ||
| } | ||
|
|
||
| func (b *Binlog) String() string { | ||
| return "BINLOG" | ||
| } | ||
|
|
||
| func (b *Binlog) Resolved() bool { | ||
| return true | ||
| } | ||
|
|
||
| func (b *Binlog) Schema() sql.Schema { | ||
| return types.OkResultSchema | ||
| } | ||
|
|
||
| func (b *Binlog) Children() []sql.Node { | ||
| return nil | ||
| } | ||
|
|
||
| func (b *Binlog) IsReadOnly() bool { | ||
| return false | ||
| } | ||
|
|
||
| // WithChildren implements the Node interface. | ||
| func (b *Binlog) WithChildren(children ...sql.Node) (sql.Node, error) { | ||
| if len(children) != 0 { | ||
| return nil, sql.ErrInvalidChildrenNumber.New(b, len(children), 0) | ||
| } | ||
| return b, nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.