fix(oracle): skip SQL pagination clauses for Oracle 11g compatibility
Oracle 11g does not support FETCH FIRST / LIMIT syntax. Skip appending pagination clauses at SQL level and rely on JDBC setMaxRows for row limiting, which already works across all Oracle versions.
This commit is contained in:
1 parent
025a4fdcce
commit
619573a69d
2 files changed
+11
-3
No files matched your search
@@ -110,6 +110,10 @@ pub fn build_table_data_select_sql(options: TableDataSelectSqlOptions) -> String
|
||||
);
|
||||
}
|
||||
|
||||
if database_type == Some(DatabaseType::Oracle) {
|
||||
return format!("SELECT {select_columns} FROM {table_alias}{where_clause}{order}");
|
||||
}
|
||||
|
||||
if database_type.is_some_and(uses_fetch_first) {
|
||||
let offset = options
|
||||
.offset
|
||||
@@ -865,7 +869,7 @@ mod tests {
|
||||
where_input: None,
|
||||
include_row_id: true,
|
||||
}),
|
||||
"SELECT ROWIDTOCHAR(t.ROWID) AS \"__DBX_ROWID\", t.* FROM \"DBXTEST\".\"DBX_LOAD_TABLE_006\" t ORDER BY t.ROWID ASC FETCH FIRST 100 ROWS ONLY"
|
||||
"SELECT ROWIDTOCHAR(t.ROWID) AS \"__DBX_ROWID\", t.* FROM \"DBXTEST\".\"DBX_LOAD_TABLE_006\" t ORDER BY t.ROWID ASC"
|
||||
);
|
||||
assert_eq!(
|
||||
build_table_data_select_sql(TableDataSelectSqlOptions {
|
||||
|
||||
Reference in new issue
Block a user