Bug #111089 | MySqlDataReader in C# does not recognize double backslash correctly | ||
---|---|---|---|
Submitted: | 19 May 2023 16:27 | Modified: | 24 Jul 2023 13:52 |
Reporter: | Siehe eMail | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Windows | Severity: | S3 (Non-critical) |
Version: | 8.0.33 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | query double backslash |
[19 May 2023 16:27]
Siehe eMail
[24 Jul 2023 13:04]
MySQL Verification Team
Hello! Thank you for the bug report . I tried to reproduce your issue on windows 11 with workbench 8.0.33 using details provided but I am not seeing any issues at my end. Running the SELECT is not returning ID neither in Workbench nor in C#. If you can provide the C# test case, feel free to add to this bug. Thanks. Regards, Ashwini Patil
[24 Jul 2023 13:52]
Siehe eMail
Hey Ashwini, thanks for your reply and checking. This is the C# method used to query the database: private string get_StepID(string checkBox_String) { string StepID = ""; try { string query = ""; query += " SELECT"; query += " Step.ID"; query += " FROM"; query += " Step"; query += " WHERE"; if (checkBox_String.Contains("\\")) { checkBox_String.Replace("\\", "\\\\"); } query += " Step.Stepname = '" + checkBox_String + "'"; MySqlDataReader reader = broker.parallelQuery(query); if ((reader is null) || (!reader.HasRows)) return ""; while (reader.Read()) { if (!reader.IsDBNull(0)) { StepID = reader.GetString(0); } } reader.Close(); } catch (Exception ex) { pmLogWriter.AddLogEntry(ex.Message, ex.StackTrace, "Error", ex); } return StepID; } While the same query SELECT Step.ID FROM Step WHERE Step.Stepname = 'ggf. Links unter \\Desktop\\Fachverfahren, \\Desktop\\OtherFolder bzw. Browserfavoriten IE/FF in GPO anpassen'; works in SQLDeveloper and returns the ID, it does return null in C# for me. I'll attach a picture of SQLDeveloper too. Many thanks, Frank