DML to lookup VIndexes unconditionally takes a row lock on rows in the
lookup VIndex backing table. Add an option to optionally elide this lock
for cases where we know via business logic that the row will not be
deleted, nor the lookup column changed.
Signed-off-by: Max Englander <max@planetscale.com>
Signed-off-by: Max Englander <max@planetscale.com>
Add a VIndex option to skip verify-after-insert behavior when using INSERT...IGNORE or INSERT...ON DUPLICATE KEY UPDATE.
Co-authored-by: Harshit Gangal <harshit@planetscale.com>
Co-authored-by: Jacques Grove <aquarapid@gmail.com>
Signed-off-by: Max Englander <max@planetscale.com>
Signed-off-by: Max Englander <max@planetscale.com>
* Release notes for 15.0.3
Signed-off-by: Matt Lord <mattalord@gmail.com>
* Release commit for 15.0.3
Signed-off-by: Matt Lord <mattalord@gmail.com>
* Rename directory
Signed-off-by: Matt Lord <mattalord@gmail.com>
* Update changelog/15.0/15.0.3/release_notes.md
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
---------
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
Co-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
* Reset the current lag when closing the replication lag reader.
* Fix tests.
---------
Signed-off-by: Johan Stenberg <johanstenberg92@github.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Johan Stenberg <johanstenberg92@github.com>
* Use a left join to make sure that tables with tablespace=innodb_system are not skipped when loading the schema (fixes#12669)
Signed-off-by: Oleksiy Kovyrin <oleksiy.kovyrin@shopify.com>
* Set tablespace on a test table to see if it breaks vstreamer
Signed-off-by: Oleksiy Kovyrin <oleksiy.kovyrin@shopify.com>
---------
Signed-off-by: Oleksiy Kovyrin <oleksiy.kovyrin@shopify.com>
Co-authored-by: Oleksiy Kovyrin <oleksiy.kovyrin@shopify.com>
* Auto upgrade the Golang version (#12585)
* initial addition of the go_upgrade tool to detect and bump the golang version
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* update go.mod automatically
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* fix isSameMajor version issue
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* update the bootstrap version automatically
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* update the bootstrap docker image changelog
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* uncomment code
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* addition of workflow
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* addition of base to create-pull-request
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* test create PR alternative
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* add flags and getter methods
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* better PR message
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* fix no-workflow-update flag and better PR body msg
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* fix PR title, branch and body format
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* test matrix and pwd path
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* enhanced matrix
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* update_workflows option
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* update workflows independently
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* test without matrix
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Add docs to go_upgrade and re-add matrix to the workflow
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* support major version upgrade
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* do not update bootstrap version if they are the same
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* migrate to cobra instead of pflags
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* remove redundant comment
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* safety net around replaceGoVersionInCodebase to avoid unrequired upgrade
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Remove double negation in workflowUpdate flag
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Use regexp instead of mere string comparison
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Proper regexp for every string comparison
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* use better regex
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* remove useless flag and improve the auto-PR body description
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* add note in the tool usage to run the tool at the root of the repo
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* add comment in .github/workflows/update_golang_version.yml
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Apply @mattlord code suggestion
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* replace usages of old filename
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Apply suggestions from code review
Co-authored-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
---------
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
* Fix regexp
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* remove the use of DateOnly
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
---------
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
* [planner bugfix] add expressions to HAVING
When a predicate contains aggregation, it should not
be added to the WHERE clause. It should go to the
* update test expecteations
---------
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Andres Taylor <andres@planetscale.com>
* [gen4 planner] Make sure to not push down expressions when not possible (#12607)
* Fix random aggregation to not select Null column
* stop pushing down projections that should be evaluated at the vtgate level
* undo changes to AggregateRandom
* clean up code
* fix executor test mock
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
* Fix schema error
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
---------
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
* Mysqld.GetSchema: tolerate tables being dropped while inspecting schema
* lack of primary key columns in STATISTICS does not mean table is dropped. It can also mean the table does not have PRIMARY KEY
* populate validTds rather than rely on nil hints
* re-introdce earlier check
* use validTds, sync
* due to many tests consistently failing, trying a different approach: we keep the table, but with empty column/key/fields info
* grammar
---------
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
* fix type conversion in query.go for the bitMap size
* enhance the TestHighNumberOfParams test
* fix test comment
---------
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
* Purge logs without panicking
* Purge logs without panicking
* try moving the goroutine to the func itself
---------
Signed-off-by: Andrew Mason <andrew@planetscale.com>
* handle filter on top of UNION
Signed-off-by: Andres Taylor <andres@planetscale.com>
* fix: conflict
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
---------
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Co-authored-by: Harshit Gangal <harshit@planetscale.com>
* collations: fix sorting in UCA900 collations
When using the fast iterator to _compare_ two strings with an UCA
collation, we need to keep in mind that the weights in the collation are
in BIG ENDIAN (this is the output format for the weight strings, so we
store the weights this way), so comparing them directly will not result
in the proper collation order. They need to be byte-swapped before they
can be compared with an arithmetic operation!
* collations: comment
---------
Signed-off-by: Vicent Marti <vmg@strn.cat>
* [planner] Schema information on the information_schema views (#11941)
* add info_schema information
Signed-off-by: Andres Taylor <andres@planetscale.com>
* add SchemaInformation handling for info_schema tables
Signed-off-by: Andres Taylor <andres@planetscale.com>
* fix bad test query
Signed-off-by: Andres Taylor <andres@planetscale.com>
* add support for information_schema on mysql 5.7
Signed-off-by: Andres Taylor <andres@planetscale.com>
* columns sorted just like mysql, and tests for 5.7
Signed-off-by: Andres Taylor <andres@planetscale.com>
* test: skip test that should not run
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
* Fix for USING when column names not lower cased (#12379)
Signed-off-by: Andres Taylor <andres@planetscale.com>
---------
Signed-off-by: Andres Taylor <andres@planetscale.com>
* Add a Run func to `vtctldclient`'s Root command to return an error on unknown command
Closes#12480.
* Add test
* flags test data
---------
Signed-off-by: Andrew Mason <andrew@planetscale.com>
* BugFix: Unsharded query using a derived table and a dual table (#12484)
* test: add failing test for a query in an unsharded keyspace using a derived table and reference table
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: fix logic to check if a single unsharded keyspace is used
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: fix test output
Signed-off-by: Manan Gupta <manan@planetscale.com>
---------
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: remove test files
Signed-off-by: Manan Gupta <manan@planetscale.com>
---------
Signed-off-by: Manan Gupta <manan@planetscale.com>
* check filter later in loadTablets. Add tests to confirm expected behavior
* remove unnecessary assignment
* add some explanation around TestFilterByKeypsaceSkipsIgnoredTablets
* simplify filter check logic as well as major test cleanup, using testify where possible
---------
Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
Co-authored-by: Brian Ramos <brirams@users.noreply.github.com>
* fix: aggregation coming from right hand side of left join check for null
* test: added a sum test
* addressed review comments
---------
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
* Move vtorc from go-sqlite3 to modernc.org/sqlite (#12214)
* Move vtorc from go-sqlite3 to modernc.org/sqlite
This moves vtorc from the go-sqlite3 library that uses CGO, to use
modernc.org/sqlite which is a pure Go implementation.
vtorc is the only component we have to build with CGO but it's causing
pain for releases since we need to build it against an old Linux for
linking against glibc.
Using modernc.org/sqlite allows for using Go only again and makes all
Vitess components buildable without CGO.
In
https://datastation.multiprocess.io/blog/2022-05-12-sqlite-in-go-with-and-without-cgo.html
someone ran some basic benchmarks. It shows that the pure Go version can
be twice as slow, but the usage of vtorc is very limited and we operate
on small datasets, so I think the performance impact purely of a
somewhat slower sqlite implementation is negligable.
None of this is in a hot query serving path or anything like that, so I
have little concern performance wise.
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
* Fix error handling in RowToArray
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
---------
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
* empty-commit
Signed-off-by: Manan Gupta <manan@planetscale.com>
* Run go mod tidy
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
---------
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
* test: show that `autocommit` on lookup vindexes is broken when used after a savepoint is created
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
* test: rework the test case to show that the problem lies with transactions
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
* Correctly handle `autocommit` in the `VIndexLookup` primitive.
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
* Copy the `logging` struct so autocommit queries show up correctly in `vexplain` output.
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
---------
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
* Ensure secondary maps stay in sync with authoritative map on delete
Signed-off-by: Matt Lord <mattalord@gmail.com>
* Remove all possible entries for a tablet alias in secondary maps
Signed-off-by: Matt Lord <mattalord@gmail.com>
* Add unit test case
Signed-off-by: Matt Lord <mattalord@gmail.com>
---------
Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
* feat: add failing parsing test and fix parser
Signed-off-by: Manan Gupta <manan@planetscale.com>
* test: add e2e tests for interval with math functions
Signed-off-by: Manan Gupta <manan@planetscale.com>
* test: explictly set the time-zone to prevent failures in CI
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
* CI: remove pitrtls test
Signed-off-by: deepthi <deepthi@planetscale.com>
* feat: update onclose timeout to 10 seconds
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
* test: fix unit test
Signed-off-by: Manan Gupta <manan@planetscale.com>
* test: fix flaky test by not checking for an error
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: handle the case of empty hostname in tablet initialization
Signed-off-by: Manan Gupta <manan@planetscale.com>
* CI: don't run backup_transform tests during upgrade/downgrade because it has been removed in v16
Signed-off-by: deepthi <deepthi@planetscale.com>
* flaky test fix - use new flag in v15
Signed-off-by: deepthi <deepthi@planetscale.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>