MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:rburnett Date:May 22 2009 9:31pm
Subject:Connector/NET commit: r1622 - in branches/6.0: . MySql.Data/Provider/Source/common MySql.Data/Tests/Source
View as plain text  
Modified:
   branches/6.0/CHANGES
   branches/6.0/MySql.Data/Provider/Source/common/MySqlTokenizer.cs
   branches/6.0/MySql.Data/Tests/Source/Syntax2.cs
Log:
- fixed tokenization of escaped backslashes (bug #44960)


Modified: branches/6.0/CHANGES
===================================================================
--- branches/6.0/CHANGES	2009-05-22 17:34:22 UTC (rev 1621)
+++ branches/6.0/CHANGES	2009-05-22 21:31:02 UTC (rev 1622)
@@ -6,6 +6,7 @@
 - made some fixes to the syntax coloring of sql inside visual studio
 - fixed display name of triggers inside server explorer
 - fixed trigger editing
+- fixed tokenization of escaped backslashes (bug #44960)
 
 Version 6.0.3 - 4/22/09
 - fixed broken connection prompting

Modified: branches/6.0/MySql.Data/Provider/Source/common/MySqlTokenizer.cs
===================================================================
--- branches/6.0/MySql.Data/Provider/Source/common/MySqlTokenizer.cs	2009-05-22 17:34:22 UTC (rev 1621)
+++ branches/6.0/MySql.Data/Provider/Source/common/MySqlTokenizer.cs	2009-05-22 21:31:02 UTC (rev 1622)
@@ -267,7 +267,7 @@
 
                 if (escaped)
                     escaped = false;
-                if (c == '\\' && BackslashEscapes)
+                else if (c == '\\' && BackslashEscapes)
                     escaped = true;
                 pos++;
             }
@@ -278,7 +278,7 @@
 
         private bool IsQuoteChar(char c)
         {
-            return c == '`' || c == '\'' || c == '\"'; // (c == '\"' && AnsiQuotes);
+            return c == '`' || c == '\'' || c == '\"';
         }
 
         private bool IsParameterMarker(char c)

Modified: branches/6.0/MySql.Data/Tests/Source/Syntax2.cs
===================================================================
--- branches/6.0/MySql.Data/Tests/Source/Syntax2.cs	2009-05-22 17:34:22 UTC (rev 1621)
+++ branches/6.0/MySql.Data/Tests/Source/Syntax2.cs	2009-05-22 21:31:02 UTC (rev 1622)
@@ -70,6 +70,18 @@
             Assert.AreEqual(-1, cmd.LastInsertedId);
         }
 
+        /// <summary>
+        /// Bug #44960	backslash in string - connector return exeption
+        /// </summary>
+        [Test]
+        public void EscapedBackslash()
+        {
+            execSQL("CREATE TABLE Test(id INT, name VARCHAR(20))");
+
+            MySqlCommand cmd = new MySqlCommand(@"INSERT INTO Test VALUES (1, '\\=\\')", conn);
+            cmd.ExecuteNonQuery();
+        }
+
 /*        [Category("NotWorking")]
         [Test]
         public void TestCase()

Thread
Connector/NET commit: r1622 - in branches/6.0: . MySql.Data/Provider/Source/common MySql.Data/Tests/Sourcerburnett22 May