Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ then
exit 1;
fi;

LAST_TAG=$(git tag | tail -n 1);
LAST_TAG=$(git tag --sort=-creatordate | head -n 1);
MAJOR=$(echo $LAST_TAG | sed -E 's/v([0-9]+)\..*/\1/');
MINOR=$(echo $LAST_TAG | sed -E 's/v[0-9]+\.([0-9]+)\..*/\1/');
PATCH=$(echo $LAST_TAG | sed -E 's/v[0-9]+\.[0-9]+\.([0-9]+)($|-rc[0-9]+)/\1/');
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* Fix bug: GetValue(int ordinal) return DBNull.Value if fetched NULL value.
* Fix: NextResult() moves to the next result and skip the first ResultSet.
* Added specification DbDataReaderTests.
* If dataOffset is larger than the length of data, GetChars and GetBytes methods will return 0.
* If YdbDataReader is closed: `throw new InvalidOperationException("The reader is closed")`.
* InvalidOperationException on ConnectionString property has not been initialized.
* One YdbTransaction per YdbConnection. Otherwise, throw an exception: InvalidOperationException("A transaction is already in progress; nested/concurrent transactions aren't supported.").
* ConnectionString returns an empty.String when it is not set.
Expand Down
16 changes: 16 additions & 0 deletions src/Ydb.Sdk/src/Ado/ThrowHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Ydb.Sdk.Value;

namespace Ydb.Sdk.Ado;

internal static class ThrowHelper
{
internal static T ThrowInvalidCast<T>(YdbValue ydbValue)
{
throw new InvalidCastException($"Field type {ydbValue.TypeId} can't be cast to {typeof(T)} type.");
}

internal static void ThrowIndexOutOfRangeException(int columnCount)
{
throw new IndexOutOfRangeException("Ordinal must be between 0 and " + (columnCount - 1));
}
}
4 changes: 1 addition & 3 deletions src/Ydb.Sdk/src/Ado/YdbCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public override async Task<int> ExecuteNonQueryAsync(CancellationToken cancellat
{
await using var dataReader = await ExecuteReaderAsync(CommandBehavior.Default, cancellationToken);

var data = await dataReader.ReadAsync(cancellationToken)
? dataReader.IsDBNull(0) ? null : dataReader.GetValue(0)
: null;
var data = await dataReader.ReadAsync(cancellationToken) ? dataReader.GetValue(0) : null;

while (await dataReader.NextResultAsync(cancellationToken))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Ydb.Sdk/src/Ado/YdbConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public override string ConnectionString

internal YdbDataReader? LastReader { get; set; }
internal string LastCommand { get; set; } = string.Empty;
internal bool IsBusy => LastReader is { IsClosed: false };
internal bool IsBusy => LastReader is { IsOpen: true };
internal YdbTransaction? CurrentTransaction { get; private set; }

public override string DataSource => string.Empty; // TODO
Expand Down
Loading
Loading