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: mssql cursor pagination #589

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

lstrihic
Copy link
Contributor

#588

Here is the fix for MSSQL when offset is set to 0.

@lstrihic lstrihic changed the title MSSQL fix cursor pagination fix: MSSQ cursor pagination Jun 21, 2022
@lstrihic lstrihic changed the title fix: MSSQ cursor pagination fix: mssql cursor pagination Jun 21, 2022
@vmihailenco
Copy link
Member

Thanks 👍 Could you add a test to https://github.com/uptrace/bun/blob/master/internal/dbtest/query_test.go#L789-L800?

@vmihailenco
Copy link
Member

The test failure looks real:

--- FAIL: TestORM (2.64s)
    --- FAIL: TestORM/mssql2019 (0.34s)
        --- FAIL: TestORM/mssql2019/testAuthorRelations (0.00s)
            orm_test.go:132: 
                	Error Trace:	orm_test.go:132
                	            				orm_test.go:43
                	Error:      	Received unexpected error:
                	            	mssql: Invalid usage of the option NEXT in the FETCH statement.
                	Test:       	TestORM/mssql[201](https://github.com/uptrace/bun/runs/6998766509?check_suite_focus=true#step:5:202)9/testAuthorRelations

Any ideas what is wrong?

@lstrihic
Copy link
Contributor Author

The test failure looks real:

--- FAIL: TestORM (2.64s)
    --- FAIL: TestORM/mssql2019 (0.34s)
        --- FAIL: TestORM/mssql2019/testAuthorRelations (0.00s)
            orm_test.go:132: 
                	Error Trace:	orm_test.go:132
                	            				orm_test.go:43
                	Error:      	Received unexpected error:
                	            	mssql: Invalid usage of the option NEXT in the FETCH statement.
                	Test:       	TestORM/mssql[201](https://github.com/uptrace/bun/runs/6998766509?check_suite_focus=true#step:5:202)9/testAuthorRelations

Any ideas what is wrong?

I have to check.

@lstrihic
Copy link
Contributor Author

lstrihic commented Jun 22, 2022

The test failure looks real:

--- FAIL: TestORM (2.64s)
    --- FAIL: TestORM/mssql2019 (0.34s)
        --- FAIL: TestORM/mssql2019/testAuthorRelations (0.00s)
            orm_test.go:132: 
                	Error Trace:	orm_test.go:132
                	            				orm_test.go:43
                	Error:      	Received unexpected error:
                	            	mssql: Invalid usage of the option NEXT in the FETCH statement.
                	Test:       	TestORM/mssql[201](https://github.com/uptrace/bun/runs/6998766509?check_suite_focus=true#step:5:202)9/testAuthorRelations

Any ideas what is wrong?

I have to check.

In mssql to use limit we have to have defined order.

@vmihailenco vmihailenco merged commit b34ec97 into uptrace:master Jun 22, 2022
@vmihailenco
Copy link
Member

Thanks 👍

@lstrihic lstrihic deleted the mssql_cursor_pagination branch June 22, 2022 11:52
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