Syntax error when opening a transaction with Connector/NET on MariaDB 10





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I'm trying to connect my web application to a MariaDB 10 server. I already do it without problems on version 5 using MySQL Connector/NET.
With version 10 I receive an error before executing my query, when the software executes the BeginTransaction.



IDbConnection dbConnection=new MySqlConnection(connectionString);
dbConnection.BeginTransaction();


The error is a classic:



[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +384
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +379
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +119
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +901
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2308
MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +133
MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel iso) +761
MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel isolationLevel) +19


I checked connector source code and it seems to happen when it executes



cmd.CommandText = "BEGIN";
cmd.ExecuteNonQuery();


in this file https://github.com/mysql/mysql-connector-net/blob/6.9/Source/MySql.Data/Connection.cs



I filed the question as a problem with Connector/NET but I receive the same error executing "BEGIN" with HeidiSQL so maybe it's a general problem.



It seems to be connected to delimiters but it sounds strange because it's a thing internal to the connector and both HeidiSQL and my software, simply changing connection string, works correctly on MariaDB 5.



I could be due to some server configuration?










share|improve this question































    2















    I'm trying to connect my web application to a MariaDB 10 server. I already do it without problems on version 5 using MySQL Connector/NET.
    With version 10 I receive an error before executing my query, when the software executes the BeginTransaction.



    IDbConnection dbConnection=new MySqlConnection(connectionString);
    dbConnection.BeginTransaction();


    The error is a classic:



    [MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
    MySql.Data.MySqlClient.MySqlStream.ReadPacket() +384
    MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +379
    MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +119
    MySql.Data.MySqlClient.MySqlDataReader.NextResult() +901
    MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2308
    MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +133
    MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel iso) +761
    MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel isolationLevel) +19


    I checked connector source code and it seems to happen when it executes



    cmd.CommandText = "BEGIN";
    cmd.ExecuteNonQuery();


    in this file https://github.com/mysql/mysql-connector-net/blob/6.9/Source/MySql.Data/Connection.cs



    I filed the question as a problem with Connector/NET but I receive the same error executing "BEGIN" with HeidiSQL so maybe it's a general problem.



    It seems to be connected to delimiters but it sounds strange because it's a thing internal to the connector and both HeidiSQL and my software, simply changing connection string, works correctly on MariaDB 5.



    I could be due to some server configuration?










    share|improve this question



























      2












      2








      2








      I'm trying to connect my web application to a MariaDB 10 server. I already do it without problems on version 5 using MySQL Connector/NET.
      With version 10 I receive an error before executing my query, when the software executes the BeginTransaction.



      IDbConnection dbConnection=new MySqlConnection(connectionString);
      dbConnection.BeginTransaction();


      The error is a classic:



      [MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
      MySql.Data.MySqlClient.MySqlStream.ReadPacket() +384
      MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +379
      MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +119
      MySql.Data.MySqlClient.MySqlDataReader.NextResult() +901
      MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2308
      MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +133
      MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel iso) +761
      MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel isolationLevel) +19


      I checked connector source code and it seems to happen when it executes



      cmd.CommandText = "BEGIN";
      cmd.ExecuteNonQuery();


      in this file https://github.com/mysql/mysql-connector-net/blob/6.9/Source/MySql.Data/Connection.cs



      I filed the question as a problem with Connector/NET but I receive the same error executing "BEGIN" with HeidiSQL so maybe it's a general problem.



      It seems to be connected to delimiters but it sounds strange because it's a thing internal to the connector and both HeidiSQL and my software, simply changing connection string, works correctly on MariaDB 5.



      I could be due to some server configuration?










      share|improve this question
















      I'm trying to connect my web application to a MariaDB 10 server. I already do it without problems on version 5 using MySQL Connector/NET.
      With version 10 I receive an error before executing my query, when the software executes the BeginTransaction.



      IDbConnection dbConnection=new MySqlConnection(connectionString);
      dbConnection.BeginTransaction();


      The error is a classic:



      [MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
      MySql.Data.MySqlClient.MySqlStream.ReadPacket() +384
      MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +379
      MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +119
      MySql.Data.MySqlClient.MySqlDataReader.NextResult() +901
      MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2308
      MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +133
      MySql.Data.MySqlClient.MySqlConnection.BeginTransaction(IsolationLevel iso) +761
      MySql.Data.MySqlClient.MySqlConnection.BeginDbTransaction(IsolationLevel isolationLevel) +19


      I checked connector source code and it seems to happen when it executes



      cmd.CommandText = "BEGIN";
      cmd.ExecuteNonQuery();


      in this file https://github.com/mysql/mysql-connector-net/blob/6.9/Source/MySql.Data/Connection.cs



      I filed the question as a problem with Connector/NET but I receive the same error executing "BEGIN" with HeidiSQL so maybe it's a general problem.



      It seems to be connected to delimiters but it sounds strange because it's a thing internal to the connector and both HeidiSQL and my software, simply changing connection string, works correctly on MariaDB 5.



      I could be due to some server configuration?







      .net mariadb mysql-connector






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 at 14:06







      Stevie B. Gibson

















      asked Jan 3 at 10:21









      Stevie B. GibsonStevie B. Gibson

      113




      113
























          1 Answer
          1






          active

          oldest

          votes


















          0














          We had many issues with the original Connector/NET, there are well known bugs that you can't really work around, and the team behind the original connector (if there is even one) does not seem to care.



          We ended up switching to the open source MySqlConnector which is awesome.



          It implements the protocol from scratch, fixing an enormous list of known bugs in the official connector (see the bottom here).



          It also ads some extra features such as true async functionality, etc.



          Disclosure: I, and my team are in no way affiliated with the mentioned project, we just had to switch because of the bugs in the official project, and we are happy users ever since.






          share|improve this answer



















          • 1





            Thanks, I'll give it a try and I'll let you know.

            – Stevie B. Gibson
            Jan 3 at 11:34











          • I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

            – Stevie B. Gibson
            Jan 7 at 10:46












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020332%2fsyntax-error-when-opening-a-transaction-with-connector-net-on-mariadb-10%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          We had many issues with the original Connector/NET, there are well known bugs that you can't really work around, and the team behind the original connector (if there is even one) does not seem to care.



          We ended up switching to the open source MySqlConnector which is awesome.



          It implements the protocol from scratch, fixing an enormous list of known bugs in the official connector (see the bottom here).



          It also ads some extra features such as true async functionality, etc.



          Disclosure: I, and my team are in no way affiliated with the mentioned project, we just had to switch because of the bugs in the official project, and we are happy users ever since.






          share|improve this answer



















          • 1





            Thanks, I'll give it a try and I'll let you know.

            – Stevie B. Gibson
            Jan 3 at 11:34











          • I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

            – Stevie B. Gibson
            Jan 7 at 10:46
















          0














          We had many issues with the original Connector/NET, there are well known bugs that you can't really work around, and the team behind the original connector (if there is even one) does not seem to care.



          We ended up switching to the open source MySqlConnector which is awesome.



          It implements the protocol from scratch, fixing an enormous list of known bugs in the official connector (see the bottom here).



          It also ads some extra features such as true async functionality, etc.



          Disclosure: I, and my team are in no way affiliated with the mentioned project, we just had to switch because of the bugs in the official project, and we are happy users ever since.






          share|improve this answer



















          • 1





            Thanks, I'll give it a try and I'll let you know.

            – Stevie B. Gibson
            Jan 3 at 11:34











          • I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

            – Stevie B. Gibson
            Jan 7 at 10:46














          0












          0








          0







          We had many issues with the original Connector/NET, there are well known bugs that you can't really work around, and the team behind the original connector (if there is even one) does not seem to care.



          We ended up switching to the open source MySqlConnector which is awesome.



          It implements the protocol from scratch, fixing an enormous list of known bugs in the official connector (see the bottom here).



          It also ads some extra features such as true async functionality, etc.



          Disclosure: I, and my team are in no way affiliated with the mentioned project, we just had to switch because of the bugs in the official project, and we are happy users ever since.






          share|improve this answer













          We had many issues with the original Connector/NET, there are well known bugs that you can't really work around, and the team behind the original connector (if there is even one) does not seem to care.



          We ended up switching to the open source MySqlConnector which is awesome.



          It implements the protocol from scratch, fixing an enormous list of known bugs in the official connector (see the bottom here).



          It also ads some extra features such as true async functionality, etc.



          Disclosure: I, and my team are in no way affiliated with the mentioned project, we just had to switch because of the bugs in the official project, and we are happy users ever since.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 10:34









          Marcell TothMarcell Toth

          1,2281519




          1,2281519








          • 1





            Thanks, I'll give it a try and I'll let you know.

            – Stevie B. Gibson
            Jan 3 at 11:34











          • I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

            – Stevie B. Gibson
            Jan 7 at 10:46














          • 1





            Thanks, I'll give it a try and I'll let you know.

            – Stevie B. Gibson
            Jan 3 at 11:34











          • I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

            – Stevie B. Gibson
            Jan 7 at 10:46








          1




          1





          Thanks, I'll give it a try and I'll let you know.

          – Stevie B. Gibson
          Jan 3 at 11:34





          Thanks, I'll give it a try and I'll let you know.

          – Stevie B. Gibson
          Jan 3 at 11:34













          I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

          – Stevie B. Gibson
          Jan 7 at 10:46





          I tried and it works because it send "START TRANSACTION" instead of "BEGIN". Unfortunately it have a bunch of dependencies that are difficult to add to my legacy software. The strange thing is that BEGIN is a valid statement to start a transaction but also using another client, HeidiSQL, I receive the same error that I don't have in previous MariaDB versions.

          – Stevie B. Gibson
          Jan 7 at 10:46




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020332%2fsyntax-error-when-opening-a-transaction-with-connector-net-on-mariadb-10%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory