Repository navigation
Fix name collisions, SQLite :execresult with RETURNING, cross-fiber transactions and late PostgreSQL enum arrays - #53
Merged
Conversation
…ransactions and late PostgreSQL enum arrays Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…nRuby subclass on first use Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This fixes the five bugs found by the latest independent pre-release check. Each bug has a new E2E test in
tests/end2end_*.rb, and each of those tests fails onmainuntil its fix is applied.exceptions, a raise insidetransactioncommitted instead of rolling back, because the generatedExceptionmodel shadowed::Exception(all engines)test_models_named_like_core_constants_do_not_shadow_them(pg, mysql2, sqlite3)::(::Exception,::Thread,::Data,::Struct,::Set,::Monitor,::PG,::ConnectionPool, ...), in the driver templates and inTypeResolver#driver_typedata,structs,threads,processes,standard_errors,sets,strings,integers,times,encodings,monitors,mutexes,connection_pools) broke loading, transactions or the logger:execresultwithRETURNINGnever ran the statementtest_execresult_with_returning_runs_the_statement(sqlite3), newCreateTagResultquerySqlite3#exec_result_linesnow runs the statement to the end (.to_a) when it returns columnstxused from anEnumerator,Fiber,ThreadorAsynctask ran its queries on another pooled connection, outside the transaction (pg, mysql2). SQLite raisedThreadErroror hungtest_transaction_query_object_works_from_other_fibers_and_threads(pg, mysql2, sqlite3)transactionnow yields a copy of the query object bound to aTransactionConnection. It runs queries from any fiber or thread one at a time (mutex), unlocks while a nested savepoint block runs, and raisesTransactionEndedonce the transaction is over. The README documents that other query objects used from other fibers still run outside the transaction"{a,b}"string when the enum was created after the connection was configuredtest_enum_arrays_of_a_type_created_after_connecting_are_decoded(pg,lateschema)NewTypes(PG::TypeMapInRuby) map. It looks each oid up inpg_typeonce per connection, so arrays of the type becomeArray[String]Behavior change: the
txyielded bytransactionis no longerself. Code that keepstxafter the block now getsTransactionEndedinstead of silently running outside the transaction.Also in this PR:
tests/rbs_types.rbstrips the leading::from RBS types before checking them.test/fixtures/*.binandsteep_expectations.ymlare regenerated.README.md,docs/Coverage.mdanddocs/Testing.mdare updated.mainis merged in, including the cross-platform CI from CI: run codegen checks and E2E on macOS and Windows #50.Checklist
examples/is regenerated (rake sqlc_generate_process) and committedrake test, andrake end2end_*when the generated code changes)rake rubocop) and Steep-clean (rake steep)bug,enhancement,documentation, orbreaking) so the release notes are grouped correctly