fix(transfer): enable IRIS and Cache source and target data transfers

Closes #10660
This commit is contained in:
t8y2 committed 2026-10-02 23:00:28 +00:00
1 parent ef9bbe2405
commit 9338e69fb7
8 files changed
+422 -33

No files matched your search

+2 -2
View File
@@ -43,8 +43,8 @@ pub use identifiers::{
transfer_column_identifier,
};
pub use table_select::{
build_count_table_sql, build_table_data_select_sql, build_table_data_select_sql_with_database,
build_table_select_sql, DBX_LARGE_VALUE_BYTES_COLUMN_PREFIX,
build_count_table_sql, build_iris_table_select_sql, build_table_data_select_sql,
build_table_data_select_sql_with_database, build_table_select_sql, DBX_LARGE_VALUE_BYTES_COLUMN_PREFIX,
};
pub use table_select::{
database_qualified_table_name, neo4j_element_id_function, quote_table_data_identifier,
@@ -339,7 +339,7 @@ pub fn build_table_data_select_sql_with_database(
if options.use_driver_row_offset {
format!("SELECT {select_columns} FROM {table_alias}{where_clause}{order}")
} else {
build_iris_table_select_sql(&select_columns, &table_alias, &where_clause, &order, limit, offset)
build_iris_table_select_sql(&select_columns, &table_alias, &where_clause, &order, limit, offset as u64)
}
}
TablePaginationStrategy::InformixFirst => {
@@ -679,24 +679,23 @@ fn quoted_table_columns_or_star(database_type: Option<DatabaseType>, columns: &[
/// Builds one page of a Caché/IRIS table read.
///
/// InterSystems SQL has `TOP` but no `OFFSET` clause — both Caché 2016 and IRIS
/// reject `SELECT TOP n ... OFFSET m` — so later pages bound a derived table
/// with `TOP(offset + limit)` and drop the leading rows with `%VID`, the row
/// Caché and older IRIS SQL have `TOP` but no `OFFSET` clause, so later pages
/// bound a derived table with `TOP(offset + limit)` and drop the leading rows with `%VID`, the row
/// number InterSystems assigns to the rows a query produces. Running the same
/// `TOP limit` statement for every page was the reason the grid kept showing
/// the first page (#8929).
fn build_iris_table_select_sql(
pub fn build_iris_table_select_sql(
select_columns: &str,
table_alias: &str,
where_clause: &str,
order: &str,
limit: usize,
offset: usize,
offset: u64,
) -> String {
if offset == 0 {
return format!("SELECT TOP {limit} {select_columns} FROM {table_alias}{where_clause}{order}");
}
let window = offset.saturating_add(limit);
let window = offset.saturating_add(limit as u64);
format!(
"SELECT * FROM (SELECT TOP {window} {select_columns} FROM {table_alias}{where_clause}{order}) WHERE %VID > {offset}"
)