question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merge API does not work in MySql

See original GitHub issue
Exception message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MERGE INTO `Language` Target
USING
(
	VALUES
	(0x08D68D024AAA54E8F8E0E388D57' at line 1
Stack trace:

   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at LinqToDB.Data.DataConnection.ExecuteNonQuery()
   at LinqToDB.Data.CommandInfo.Execute()
   at LinqToDB.DataProvider.BasicMerge.Execute(DataConnection dataConnection)
   at LinqToDB.Data.DataConnectionExtensions.Merge[T](DataConnection dataConnection, IEnumerable`1 source, String tableName, String databaseName, String schemaName)

Environment details

linq2db version: 2.6.0,2.6.4 Database Server: MySql 8.0 Database Provider: MySql.Data 8.0.15 Operating system: E.g. Windows 7 / CentOS 7 Framework version: .NET Framework 4.6.2 / Mono (latest)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MaceWinducommented, Feb 7, 2019

BasicMerge is legacy SQL Server-only implementation with a lot of issues/limitations.

Current merge implemented by BasicMergeBuilder and it’s descendands for concrete providers and will be substituted by #1512 in v3

0reactions
MaceWinducommented, Jun 14, 2020

Gonna close it as duplicate of #1480

Read more comments on GitHub >

github_iconTop Results From Across the Web

trouble finding error in MYSQL 8 MERGE STATEMENT
The EDW_STAGE database is a staging database that will merge daily information into the EDW. I'm trying to run a merge from EDW_STAGE...
Read more >
16.7.2 MERGE Table Problems
Because the MERGE engine cannot enforce uniqueness over the set of underlying tables, REPLACE does not work as expected. The two key facts...
Read more >
MySQL: Merge Same Database on Several Location into ...
Let me first suggest an approach that may not work for you, but it seems the ideal approach for saving bandwidth and resources:....
Read more >
Is there a simple way to merge a broken 2-way-MySQL ...
My problem with just restarting it, is that replication has been broken for a sufficient time before I was put onto this that...
Read more >
db_merge | database.inc | Drupal 7
I have spent some hours to figure out a db_merge command fails because of I use "group" as column name of the table....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found