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

Fix sqlite update return and order by type inference #1960

Merged
merged 8 commits into from
Sep 15, 2022

Conversation

tyrelr
Copy link
Contributor

@tyrelr tyrelr commented Jul 11, 2022

Track empty/non-empty/unknown-emptiness of cursors as part of the state. That enables Rewind/Last operations to filter which branch path to take (instead of always assuming both paths are potentially valid). Also updates Move/Copy to handle the use use of those opcodes against a range of registers.

Fixes #1923
Fixes #1979

@tyrelr

This comment was marked as outdated.

@tyrelr tyrelr force-pushed the fix-sqlite-update-return branch from 9582d65 to 269b0c5 Compare July 13, 2022 04:42
@tyrelr tyrelr marked this pull request as ready for review July 13, 2022 04:50
@abonander
Copy link
Collaborator

Hopefully a rebase will fix the CI failures.

@tyrelr tyrelr force-pushed the fix-sqlite-update-return branch from 269b0c5 to 7e29be3 Compare July 15, 2022 03:49
@abonander
Copy link
Collaborator

This would close #1923 right?

Unfortunately any change to null inference would be a breaking change so this will have to wait for 0.7.0. Fortunately we don't plan for the 0.6.x release cycle to be as long as 0.5.x, though I don't want to give a concrete timeline since things always change.

@tyrelr
Copy link
Contributor Author

tyrelr commented Jul 16, 2022

Yep, it fixes #1923 (which impacts the calculated nullability).

@tyrelr tyrelr marked this pull request as draft July 18, 2022 06:10
@tyrelr tyrelr marked this pull request as ready for review July 22, 2022 05:34
@tyrelr tyrelr changed the title Fix sqlite update return Fix sqlite update return type inference Jul 22, 2022
@tyrelr tyrelr changed the title Fix sqlite update return type inference Fix sqlite update return and order by type inference Jul 22, 2022
@abonander abonander added this to the 0.7.0 milestone Sep 3, 2022
@abonander abonander changed the base branch from main to 0.7-dev September 15, 2022 00:37
@abonander
Copy link
Collaborator

PR target changed to the 0.7 development branch.

@abonander abonander merged commit 280e65f into launchbadge:0.7-dev Sep 15, 2022
@cycraig cycraig mentioned this pull request Sep 18, 2022
abonander pushed a commit that referenced this pull request Feb 18, 2023
* add failing test cases for update/delete return into

* fix regression in null tracking by improving tracking of cursor empty/full state

* add failing test case for order by column types

* Add support for SorterOpen,SorterInsert,SorterData

* add failing test case for unions

* fix range copy/move implementation

* fix wrong copy/move range

* remove calls to dbg!
abonander pushed a commit that referenced this pull request Feb 21, 2023
* add failing test cases for update/delete return into

* fix regression in null tracking by improving tracking of cursor empty/full state

* add failing test case for order by column types

* Add support for SorterOpen,SorterInsert,SorterData

* add failing test case for unions

* fix range copy/move implementation

* fix wrong copy/move range

* remove calls to dbg!
Aandreba pushed a commit to Aandreba/sqlx that referenced this pull request Mar 31, 2023
* add failing test cases for update/delete return into

* fix regression in null tracking by improving tracking of cursor empty/full state

* add failing test case for order by column types

* Add support for SorterOpen,SorterInsert,SorterData

* add failing test case for unions

* fix range copy/move implementation

* fix wrong copy/move range

* remove calls to dbg!
tyrelr added a commit to tyrelr/sqlx that referenced this pull request Feb 18, 2024
tyrelr added a commit to tyrelr/sqlx that referenced this pull request Apr 20, 2024
abonander pushed a commit that referenced this pull request May 31, 2024
* convert logger to output a query graph

* avoid duplicating branch paths to shrink output graph

* separate different branching paths

* include all branches which found unique states

* track the reason for ending each branches execution

* track the result type of each branch

* make edges rely on history index instead of program_id, to avoid errors when looping

* add state diff to query graph

* drop redundant table info

* rework graph to show state changes, rework logger to store state snapshots

* show state on the previous operation

* gather duplicate state changes into clusters to reduce repetition

* draw invisible connections between unknown instructions by program_i

* clean up dot format string escaping

* add test case from #1960 (update returning all columns)

* add tests for #2939 (update returning only the PK column)

* allow inserting into a table using only the index

* improve null handling of IfNull, fix output type of NewRowId

* add NoResult nodes for branches which don't log a result, as a sanity check

* add short-circuit to all logging operations

* remove duplicate logging checks, and make logging enabled/disabled consistently depend on sqlx::explain instead of sqlx for capture & sqlx::explain for output

* add failing test for awkwardly nested/filtered count subquery

* handle special case of return operation to fix failing test

* require trace log level instead of using whatever log level  statement logging was configured to use
jayy-lmao pushed a commit to jayy-lmao/sqlx that referenced this pull request Jun 6, 2024
* convert logger to output a query graph

* avoid duplicating branch paths to shrink output graph

* separate different branching paths

* include all branches which found unique states

* track the reason for ending each branches execution

* track the result type of each branch

* make edges rely on history index instead of program_id, to avoid errors when looping

* add state diff to query graph

* drop redundant table info

* rework graph to show state changes, rework logger to store state snapshots

* show state on the previous operation

* gather duplicate state changes into clusters to reduce repetition

* draw invisible connections between unknown instructions by program_i

* clean up dot format string escaping

* add test case from launchbadge#1960 (update returning all columns)

* add tests for launchbadge#2939 (update returning only the PK column)

* allow inserting into a table using only the index

* improve null handling of IfNull, fix output type of NewRowId

* add NoResult nodes for branches which don't log a result, as a sanity check

* add short-circuit to all logging operations

* remove duplicate logging checks, and make logging enabled/disabled consistently depend on sqlx::explain instead of sqlx for capture & sqlx::explain for output

* add failing test for awkwardly nested/filtered count subquery

* handle special case of return operation to fix failing test

* require trace log level instead of using whatever log level  statement logging was configured to use
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
* convert logger to output a query graph

* avoid duplicating branch paths to shrink output graph

* separate different branching paths

* include all branches which found unique states

* track the reason for ending each branches execution

* track the result type of each branch

* make edges rely on history index instead of program_id, to avoid errors when looping

* add state diff to query graph

* drop redundant table info

* rework graph to show state changes, rework logger to store state snapshots

* show state on the previous operation

* gather duplicate state changes into clusters to reduce repetition

* draw invisible connections between unknown instructions by program_i

* clean up dot format string escaping

* add test case from launchbadge#1960 (update returning all columns)

* add tests for launchbadge#2939 (update returning only the PK column)

* allow inserting into a table using only the index

* improve null handling of IfNull, fix output type of NewRowId

* add NoResult nodes for branches which don't log a result, as a sanity check

* add short-circuit to all logging operations

* remove duplicate logging checks, and make logging enabled/disabled consistently depend on sqlx::explain instead of sqlx for capture & sqlx::explain for output

* add failing test for awkwardly nested/filtered count subquery

* handle special case of return operation to fix failing test

* require trace log level instead of using whatever log level  statement logging was configured to use
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
* convert logger to output a query graph

* avoid duplicating branch paths to shrink output graph

* separate different branching paths

* include all branches which found unique states

* track the reason for ending each branches execution

* track the result type of each branch

* make edges rely on history index instead of program_id, to avoid errors when looping

* add state diff to query graph

* drop redundant table info

* rework graph to show state changes, rework logger to store state snapshots

* show state on the previous operation

* gather duplicate state changes into clusters to reduce repetition

* draw invisible connections between unknown instructions by program_i

* clean up dot format string escaping

* add test case from launchbadge#1960 (update returning all columns)

* add tests for launchbadge#2939 (update returning only the PK column)

* allow inserting into a table using only the index

* improve null handling of IfNull, fix output type of NewRowId

* add NoResult nodes for branches which don't log a result, as a sanity check

* add short-circuit to all logging operations

* remove duplicate logging checks, and make logging enabled/disabled consistently depend on sqlx::explain instead of sqlx for capture & sqlx::explain for output

* add failing test for awkwardly nested/filtered count subquery

* handle special case of return operation to fix failing test

* require trace log level instead of using whatever log level  statement logging was configured to use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants