Skip to content

Fix bug that prevented SQL Server row limts #1136

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 1 commit into from
Apr 22, 2025

Conversation

TomMicheline
Copy link
Contributor

Fixes #1135

MsSql.sqlQueryLimit was returning the unmodified query and throwing the modified version away. Unit tests fails before fix and succeeds after.

@zaleslaw zaleslaw requested a review from Copilot April 22, 2025 09:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request fixes a bug where MsSql.sqlQueryLimit was returning the original query instead of applying the row limit. Key changes include:

  • Modifying MsSql.sqlQueryLimit to return the modified query.
  • Adding unit tests to validate the SQL Server TOP limit behavior.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/mssqlTest.kt Adds tests to verify that the TOP clause is correctly injected into SQL queries.
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/MsSql.kt Fixes the bug by returning the result of the string replacement operation.

@zaleslaw zaleslaw merged commit 58374a6 into Kotlin:master Apr 22, 2025
2 checks passed
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.

Bug in MsSql.sqlQueryLimit
3 participants