Skip to content
Permalink
Browse files

Merge branch 'hotfix/4.0.9'

  • Loading branch information...
roji committed Aug 14, 2019
2 parents 780f357 + 926af4f commit 8f47aecba33a9cbe1e100e86543eea5bb9526a41
Showing with 140 additions and 191 deletions.
  1. +1 −1 .appveyor.yml
  2. +2 −2 bump.sh
  3. +3 −0 src/Directory.Build.props
  4. +0 −1 src/Npgsql.GeoJSON/Npgsql.GeoJSON.csproj
  5. +0 −1 src/Npgsql.Json.NET/Npgsql.Json.NET.csproj
  6. +0 −1 src/Npgsql.LegacyPostgis/Npgsql.LegacyPostgis.csproj
  7. +0 −1 src/Npgsql.NetTopologySuite/Npgsql.NetTopologySuite.csproj
  8. +0 −1 src/Npgsql.NodaTime/Npgsql.NodaTime.csproj
  9. +0 −1 src/Npgsql.RawPostgis/Npgsql.RawPostgis.csproj
  10. +2 −2 src/Npgsql/BackendMessages/AuthenticationMessages.cs
  11. +1 −1 src/Npgsql/BackendMessages/ErrorOrNoticeMessage.cs
  12. +1 −1 src/Npgsql/ConnectorPool.cs
  13. +1 −1 src/Npgsql/Counters.cs
  14. +1 −1 src/Npgsql/KerberosUsernameProvider.cs
  15. +2 −37 src/Npgsql/Logging/NpgsqlLogManager.cs
  16. +0 −1 src/Npgsql/Npgsql.csproj
  17. +8 −8 src/Npgsql/NpgsqlBinaryExporter.cs
  18. +3 −3 src/Npgsql/NpgsqlBinaryImporter.cs
  19. +10 −10 src/Npgsql/NpgsqlCommand.cs
  20. +1 −1 src/Npgsql/NpgsqlConnection.cs
  21. +8 −8 src/Npgsql/NpgsqlConnector.Auth.cs
  22. +3 −3 src/Npgsql/NpgsqlConnector.cs
  23. +9 −9 src/Npgsql/NpgsqlDataReader.cs
  24. +1 −1 src/Npgsql/NpgsqlFactory.cs
  25. +57 −76 src/Npgsql/NpgsqlParameterCollection.cs
  26. +5 −5 src/Npgsql/NpgsqlRawCopyStream.cs
  27. +1 −1 src/Npgsql/NpgsqlTransaction.cs
  28. +8 −4 src/Npgsql/PGUtil.cs
  29. +1 −1 src/Npgsql/PostgresDatabaseInfo.cs
  30. +1 −1 src/Npgsql/PreparedStatementManager.cs
  31. +3 −0 src/Npgsql/TypeHandlers/ByteaHandler.cs
  32. +3 −3 src/Npgsql/TypeHandlers/TextHandler.cs
  33. +1 −1 src/Npgsql/TypeMapping/ConnectorTypeMapper.cs
  34. +1 −1 src/Npgsql/VolatileResourceManager.cs
  35. +1 −1 src/VSIX/Properties/AssemblyInfo.cs
  36. +1 −1 src/VSIX/source.extension.vsixmanifest
@@ -1,5 +1,5 @@
image: Visual Studio 2017
version: 4.0.7-{build}
version: 4.0.9-{build}
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -12,12 +12,12 @@ if [[ $v == *"-" ]]; then
fi

sed -i 's/^version: .*/version: '$v'-{build}/' .appveyor.yml
sed -i 's/<VersionPrefix>[^<]*<\/VersionPrefix>/<VersionPrefix>'$v'<\/VersionPrefix>/' src/Npgsql/Npgsql.csproj
sed -i 's/<VersionPrefix>[^<]*<\/VersionPrefix>/<VersionPrefix>'$v'<\/VersionPrefix>/' src/Directory.Build.props
sed -i 's/\(<Identity .*Version=\)"[^"]*"/\1"'$v'"/' src/VSIX/source.extension.vsixmanifest
sed -i 's/.*ProvideBindingRedirection.*/[assembly: ProvideBindingRedirection(AssemblyName = "Npgsql", NewVersion = "'$v'.0", OldVersionLowerBound = "0.0.0.0", OldVersionUpperBound = "'$v'.0")]/' src/VSIX/Properties/AssemblyInfo.cs

git add .appveyor.yml
git add src/Npgsql/Npgsql.csproj
git add src/Directory.Build.props
git add src/VSIX/source.extension.vsixmanifest
git add src/VSIX/Properties/AssemblyInfo.cs

@@ -1,4 +1,7 @@
<Project>
<PropertyGroup>
<VersionPrefix>4.0.9</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.1" PrivateAssets="All" />
</ItemGroup>
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>GeoJSON plugin for Npgsql, allowing mapping of PostGIS geometry types to GeoJSON types.</Description>
<Authors>Yoh Deadfall, Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.</Description>
<Authors>Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).</Description>
<Authors>Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.</Description>
<Authors>Yoh Deadfall, Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>NodaTime plugin for Npgsql, allowing mapping of PostgreSQL date/time types to NodaTime types.</Description>
<Authors>Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>4.0.8</VersionPrefix>
<Description>PostGIS plugin for Npgsql, allowing raw byte access to PostGIS ypes.</Description>
<Authors>Shay Rojansky</Authors>
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
@@ -151,7 +151,7 @@ internal AuthenticationSASLContinueMessage(NpgsqlReadBuffer buf, int len)

class AuthenticationSCRAMServerFirstMessage
{
static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(AuthenticationSCRAMServerFirstMessage));

internal string Nonce { get; }
internal string Salt { get; }
@@ -196,7 +196,7 @@ internal AuthenticationSASLFinalMessage(NpgsqlReadBuffer buf, int len)

class AuthenticationSCRAMServerFinalMessage
{
static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(AuthenticationSCRAMServerFinalMessage));

internal string ServerSignature { get; }

@@ -48,7 +48,7 @@ class ErrorOrNoticeMessage
internal string Line { get; private set; }
internal string Routine { get; private set; }

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(ErrorOrNoticeMessage));

// ReSharper disable once FunctionComplexityOverflow
internal ErrorOrNoticeMessage(NpgsqlReadBuffer buf)
@@ -118,7 +118,7 @@ public override string ToString()
/// </summary>
internal const int PoolSizeLimit = 1024;

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(ConnectorPool));

#endregion

@@ -50,7 +50,7 @@ static class Counters
static bool _initialized;
static readonly object InitLock = new object();

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(Counters));

#pragma warning disable CA1801 // Review unused parameters
internal static void Initialize(bool usePerfCounters)
@@ -40,7 +40,7 @@ class KerberosUsernameProvider
static string _principalWithRealm;
static string _principalWithoutRealm;

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(KerberosUsernameProvider));

[CanBeNull]
internal static string GetUsername(bool includeRealm)
@@ -31,7 +31,7 @@
namespace Npgsql.Logging
{
/// <summary>
/// Manages logging for Npgsql, used to set the loggging provider.
/// Manages logging for Npgsql, used to set the logging provider.
/// </summary>
public static class NpgsqlLogManager
{
@@ -63,42 +63,7 @@ public static INpgsqlLoggingProvider Provider
static INpgsqlLoggingProvider _provider;
static bool _providerRetrieved;

internal static NpgsqlLogger CreateLogger(string name)
{
return Provider.CreateLogger(name);
}

internal static NpgsqlLogger GetCurrentClassLogger()
{
return CreateLogger(GetClassFullName());
}

// Copied from NLog
static string GetClassFullName()
{
string className;
Type declaringType;
int framesToSkip = 2;

do {
#if SILVERLIGHT
StackFrame frame = new StackTrace().GetFrame(framesToSkip);
#else
StackFrame frame = new StackFrame(framesToSkip, false);
#endif
MethodBase method = frame.GetMethod();
declaringType = method.DeclaringType;
if (declaringType == null) {
className = method.Name;
break;
}

framesToSkip++;
className = declaringType.FullName;
} while (declaringType.Module.Name.Equals("mscorlib.dll", StringComparison.OrdinalIgnoreCase));

return className;
}
internal static NpgsqlLogger CreateLogger(string name) => Provider.CreateLogger("Npgsql." + name);

static NpgsqlLogManager()
{
@@ -6,7 +6,6 @@
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
<Company>Npgsql</Company>
<PackageTags>npgsql postgresql postgres ado ado.net database sql</PackageTags>
<VersionPrefix>4.0.8</VersionPrefix>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net45;net451;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' OR '$(CoreOnly)' == 'True'">netstandard2.0</TargetFrameworks>
@@ -60,7 +60,7 @@ public sealed class NpgsqlBinaryExporter : ICancelable

[ItemCanBeNull]
readonly NpgsqlTypeHandler[] _typeHandlerCache;
static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(NpgsqlBinaryExporter));

#endregion

@@ -109,7 +109,7 @@ internal NpgsqlBinaryExporter(NpgsqlConnector connector, string copyToCommand)

void ReadHeader()
{
_leftToReadInDataMsg = Expect<CopyDataMessage>(_connector.ReadMessage()).Length;
_leftToReadInDataMsg = Expect<CopyDataMessage>(_connector.ReadMessage(), _connector).Length;
var headerLen = NpgsqlRawCopyStream.BinarySignature.Length + 4 + 4;
_buf.Ensure(headerLen);
if (NpgsqlRawCopyStream.BinarySignature.Any(t => _buf.ReadByte() != t)) {
@@ -144,7 +144,7 @@ public int StartRow()
// message per row).
if (_column == NumColumns)
{
_leftToReadInDataMsg = Expect<CopyDataMessage>(_connector.ReadMessage()).Length;
_leftToReadInDataMsg = Expect<CopyDataMessage>(_connector.ReadMessage(), _connector).Length;
}
else if (_column != -1)
{
@@ -156,9 +156,9 @@ public int StartRow()
if (numColumns == -1)
{
Debug.Assert(_leftToReadInDataMsg == 0);
Expect<CopyDoneMessage>(_connector.ReadMessage());
Expect<CommandCompleteMessage>(_connector.ReadMessage());
Expect<ReadyForQueryMessage>(_connector.ReadMessage());
Expect<CopyDoneMessage>(_connector.ReadMessage(), _connector);
Expect<CommandCompleteMessage>(_connector.ReadMessage(), _connector);
Expect<ReadyForQueryMessage>(_connector.ReadMessage(), _connector);
_column = -1;
_isConsumed = true;
return -1;
@@ -312,8 +312,8 @@ public void Dispose()
_buf.Skip(_leftToReadInDataMsg);
// Read to the end
_connector.SkipUntil(BackendMessageCode.CopyDone);
Expect<CommandCompleteMessage>(_connector.ReadMessage());
Expect<ReadyForQueryMessage>(_connector.ReadMessage());
Expect<CommandCompleteMessage>(_connector.ReadMessage(), _connector);
Expect<ReadyForQueryMessage>(_connector.ReadMessage(), _connector);
}

var connector = _connector;
@@ -62,7 +62,7 @@ public sealed class NpgsqlBinaryImporter : ICancelable
[ItemCanBeNull]
readonly NpgsqlParameter[] _params;

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(NpgsqlBinaryImporter));

#endregion

@@ -301,8 +301,8 @@ public void Complete()
_buf.EndCopyMode();

_connector.SendMessage(CopyDoneMessage.Instance);
Expect<CommandCompleteMessage>(_connector.ReadMessage());
Expect<ReadyForQueryMessage>(_connector.ReadMessage());
Expect<CommandCompleteMessage>(_connector.ReadMessage(), _connector);
Expect<ReadyForQueryMessage>(_connector.ReadMessage(), _connector);
_state = ImporterState.Committed;
}
catch
@@ -83,7 +83,7 @@ public sealed class NpgsqlCommand : DbCommand, ICloneable

static readonly SingleThreadSynchronizationContext SingleThreadSynchronizationContext = new SingleThreadSynchronizationContext("NpgsqlRemainingAsyncSendWorker");

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(NpgsqlCommand));

#endregion Fields

@@ -510,8 +510,8 @@ void DeriveParametersForQuery()

foreach (var statement in _statements)
{
Expect<ParseCompleteMessage>(connector.ReadMessage());
var paramTypeOIDs = Expect<ParameterDescriptionMessage>(connector.ReadMessage()).TypeOIDs;
Expect<ParseCompleteMessage>(connector.ReadMessage(), connector);
var paramTypeOIDs = Expect<ParameterDescriptionMessage>(connector.ReadMessage(), connector).TypeOIDs;

if (statement.InputParameters.Count != paramTypeOIDs.Count)
{
@@ -556,7 +556,7 @@ void DeriveParametersForQuery()
}
}

Expect<ReadyForQueryMessage>(connector.ReadMessage());
Expect<ReadyForQueryMessage>(connector.ReadMessage(), connector);
sendTask.GetAwaiter().GetResult();
}
}
@@ -636,13 +636,13 @@ async Task PrepareLong()
Debug.Assert(pStatement.Description == null);
if (pStatement.StatementBeingReplaced != null)
{
Expect<CloseCompletedMessage>(await connector.ReadMessage(async));
Expect<CloseCompletedMessage>(await connector.ReadMessage(async), connector);
pStatement.StatementBeingReplaced.CompleteUnprepare();
pStatement.StatementBeingReplaced = null;
}

Expect<ParseCompleteMessage>(await connector.ReadMessage(async));
Expect<ParameterDescriptionMessage>(await connector.ReadMessage(async));
Expect<ParseCompleteMessage>(await connector.ReadMessage(async), connector);
Expect<ParameterDescriptionMessage>(await connector.ReadMessage(async), connector);
var msg = await connector.ReadMessage(async);
switch (msg.Code)
{
@@ -661,7 +661,7 @@ async Task PrepareLong()
isFirst = false;
}

Expect<ReadyForQueryMessage>(await connector.ReadMessage(async));
Expect<ReadyForQueryMessage>(await connector.ReadMessage(async), connector);

if (async)
await sendTask;
@@ -688,12 +688,12 @@ public void Unprepare()
var sendTask = SendClose(false);
foreach (var statement in _statements.Where(s => s.PreparedStatement?.State == PreparedState.BeingUnprepared))
{
Expect<CloseCompletedMessage>(connector.ReadMessage());
Expect<CloseCompletedMessage>(connector.ReadMessage(), connector);
Debug.Assert(statement.PreparedStatement != null);
statement.PreparedStatement.CompleteUnprepare();
statement.PreparedStatement = null;
}
Expect<ReadyForQueryMessage>(connector.ReadMessage());
Expect<ReadyForQueryMessage>(connector.ReadMessage(), connector);
sendTask.GetAwaiter().GetResult();
}
}
@@ -121,7 +121,7 @@ public INpgsqlTypeMapper TypeMapper
/// </summary>
internal const int TimeoutLimit = 1024;

static readonly NpgsqlLogger Log = NpgsqlLogManager.GetCurrentClassLogger();
static readonly NpgsqlLogger Log = NpgsqlLogManager.CreateLogger(nameof(NpgsqlConnection));

static bool _countersInitialized;

0 comments on commit 8f47aec

Please sign in to comment.
You can’t perform that action at this time.