Skip to content

Odbc driver feature#596

Open
Ylonies wants to merge 21 commits intoydb-platform:mainfrom
Ylonies:odbc-driver-feature
Open

Odbc driver feature#596
Ylonies wants to merge 21 commits intoydb-platform:mainfrom
Ylonies:odbc-driver-feature

Conversation

@Ylonies
Copy link
Copy Markdown

@Ylonies Ylonies commented Apr 8, 2026

No description provided.

Comment thread odbc/src/utils/bindings.h Outdated
Comment on lines +34 to +36
virtual void OnStreamPartError(const TStatus& status) {
(void)status;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
virtual void OnStreamPartError(const TStatus& status) {
(void)status;
}
virtual void OnStreamPartError([[maybe_unused]] const TStatus& status) {
}

Comment thread odbc/src/odbc_driver.cpp
}
}

SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT handleType,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А SQLGetDiagField чем от SQLGetDiagRec отличается?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Необходимо по спеке, SQLGetDiagRec возвращает целую диагностическую запись, SQLGetDiagRec - одно поле по diagIdentifier

Comment thread odbc/src/statement.cpp
if (txSettings.GetMode() == NQuery::TTxSettings::TS_SERIALIZABLE_RW) {
return session.StreamExecuteQuery(
PreparedQuery_,
NQuery::TTxControl::NoTx(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А почему NoTx? Есть же Serializable

Comment thread odbc/src/statement.cpp Outdated
auto iterator = CreateExecuteIterator(session, params);
NStatusHelpers::ThrowOnError(iterator);

std::optional<NQuery::TExecuteQueryPart> prefetchedResultPart = PrefetchFirstResultPart(iterator);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А зачем делать prefetch?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

  1. ранняя диагностика 2) retry при autocommit прямо в execute

Comment thread odbc/src/connection_attributes.cpp Outdated
Comment on lines +8 to +30
std::optional<NQuery::TTxSettings::ETransactionMode> TConnectionAttributes::ResolveTxMode(SQLUINTEGER accessMode, SQLUINTEGER txnIsolation) {
if (accessMode == SQL_MODE_READ_ONLY) {
switch (txnIsolation) {
case SQL_TXN_READ_UNCOMMITTED:
return NQuery::TTxSettings::TS_STALE_RO;
case SQL_TXN_READ_COMMITTED:
return NQuery::TTxSettings::TS_ONLINE_RO;
case SQL_TXN_REPEATABLE_READ:
case SQL_TXN_SERIALIZABLE:
return NQuery::TTxSettings::TS_SNAPSHOT_RO;
default:
return std::nullopt;
}
}

switch (txnIsolation) {
case SQL_TXN_REPEATABLE_READ:
case SQL_TXN_SERIALIZABLE:
return NQuery::TTxSettings::TS_SERIALIZABLE_RW;
default:
return std::nullopt;
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Мы не поддерживаем SQL_TXN_READ_UNCOMMITTED и SQL_TXN_READ_COMMITTED.

SQL_TXN_REPEATABLE_READ поддерживаем в виде SnapshotRW.

SQL_TXN_SERIALIZABLE.

Про accessMode, как это работает в ODBC?

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