npgsql/EntityFramework6.Npgsql

EF6.4 error occurs in Poland, not UK

brahmsproject opened this issue · 1 comments

We encounter a problem inserting a record into a PostgreSQL database via EF 6.4 - only when running a project in Poland. We do not get the error in the UK with exactly the same record. Below the Error log is the EF log. These logs are in Polish as submitted by that project.

from application error log:

Message :An error occurred while updating the entries. See the inner exception for details.
Source :EntityFramework
Stack Trace :   w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
   w System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
   w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
   w System.Data.Entity.Internal.InternalContext.SaveChanges()
TargetSite :Int32 Update()
07:49:27.4888 ERROR 
Message :42601: błąd składni w lub blisko "="
Source :Npgsql
Stack Trace :   w Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w Npgsql.NpgsqlConnector.<>c__DisplayClass160_0.<<DoReadMessage>g__ReadMessageLong|0>d.MoveNext() w C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:wiersz 973
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w Npgsql.NpgsqlDataReader.<NextResult>d__44.MoveNext() w C:\projects\npgsql\src\Npgsql\NpgsqlDataReader.cs:wiersz 500
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w Npgsql.NpgsqlDataReader.NextResult() w C:\projects\npgsql\src\Npgsql\NpgsqlDataReader.cs:wiersz 306
   w Npgsql.NpgsqlCommand.<ExecuteReaderAsync>d__102.MoveNext() w C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:wiersz 1206
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w Npgsql.NpgsqlCommand.<ExecuteNonQuery>d__92.MoveNext() w C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:wiersz 994
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w Npgsql.NpgsqlCommand.ExecuteNonQuery() w C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:wiersz 976
   w System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   w System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   w System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
   w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
TargetSite :Void MoveNext()

The EF output was:

INSERT INTO "public"."collectionevents"("collectioneventid","recordcategoryid","collectors","collectorscode","additionalcollectors","entityid","speciesid","gazetteerid","plotheaderid","projectandgrantid","livingcollectionsource","uniquecode","collectioneventcategorycode","calctypespecimens","prefix","fieldnumber","calcsortablefieldnumber","suffix","materialcollected","localitynotes","habitattext","landform","soildescription","plantform","geology","landuse","aspect","slope","descriptiontext","cultivated","cultivationnotes","associatedspecies","height","threats","uses","phenocult","samplesize","populationsize","latitude","longitude","llresolution","llchecked","llorigin","lldatum","qds","elevation","elevationmax","elevationresolution","elevationtext","originstatus","origindatabase","originidentity","collectionday","collectionmonth","collectionyear","dateresolution","datetext","polynomial","sex","flowercode","fruitcode","labeltotal","initial","available","curationtext","hostspeciesid","abundance","dbh","count","fielddet","calcimages","calcdocuments","calcspecimens","calclivingcollections","calcseedaccessions","calclongcollectiondate","calcshortcollectiondate","calcgazetteersummary","calclatlongdms","calclivingcollectionsliving","calclivingcollectionsother","calcrestrictioncategory","calcmaterialcategory","mystring","comments","addedby","addedon","lastmodifiedby","lastmodifiedon","bolrestrictioncode","notonline","lastuploadedby","lastuploadedon","isdeleted","del","databaseprojectid","linkeddataid") VALUES (@p_0,NULL,@p_1,NULL,NULL,NULL,@p_2,@p_3,NULL,NULL,NULL,NULL,@p_4,NULL,NULL,NULL,NULL,NULL,NULL,@p_5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,@p_6,@p_7,@p_8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,@p_9,@p_10,@p_11,@p_12,NULL,@p_13,NULL,NULL,@p_14,NULL,@p_15,@p_16)

-- p_0: '21454652-490b-4c45-8b12-6de36e5eb1fc' (Type = Guid, IsNullable = false)

-- p_1: 's.coll.' (Type = Object, IsNullable = false)

-- p_2: 'fc15c505-287d-450c-9199-652f868bf304' (Type = Guid, IsNullable = false)

-- p_3: 'd4e92a15-bcc8-4059-9a30-d99fd6f3123e' (Type = Guid, IsNullable = false)

-- p_4: 'PS' (Type = Object, IsNullable = false)

-- p_5: 'Francja, Orlean, Loiret' (Type = Object, IsNullable = false)

-- p_6: '30' (Type = Int32, IsNullable = false)

-- p_7: '8' (Type = Int32, IsNullable = false)

-- p_8: '1977' (Type = Int32, IsNullable = false)

-- p_9: 'm.jarosinska' (Type = Object, IsNullable = false)

-- p_10: '18.01.2023 06:49:26' (Type = DateTime, IsNullable = false)

-- p_11: 'm.jarosinska' (Type = Object, IsNullable = false)

-- p_12: '18.01.2023 06:49:26' (Type = DateTime, IsNullable = false)

-- p_13: 'False' (Type = Boolean, IsNullable = false)

-- p_14: 'False' (Type = Boolean, IsNullable = false)

-- p_15: 'd37c6923-5655-4cee-841c-d1efef11ec05' (Type = Guid, IsNullable = false)

-- p_16: '21454652-490b-4c45-8b12-6de36e5eb1fc' (Type = Guid, IsNullable = false)

-- Executing at 18.01.2023 07:49:27 +01:00

-- Failed in 12 ms with error: 42601: błąd składni w lub blisko "="

roji commented

@brahmsproject the non-core EF 6 provider is no longer being actively maintained.

In any case, the error message seems to be about a syntax error at or around = (equality), but the INSERT SQL you quoted doesn't contain that... I'm guessing maybe you quoted a SQL that's different from the one that actually caused the problem?