Hello!
I wrote some stored functions for MySQL.
My goal is automation process of creating these stored functions
I using MySQL 5.5 in Windows server and latest version of oxide(v2.0.4394) for Rust and only one MySQL root account for programs and plugins with FULL access of all databases.
In MySQL Command line client and MySQL Workbench all work fine, i can create any stored functions/procedures.
But when i try to create stored function from C# plugin, i got this error:
MySql handle raised an exception in 'TestPlug v1.1.2' plugin
(MySqlException: 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 'DELIMITER $$' at line 1)
at MySql.Data.MySqlClient.MySqlCommand.EndExecuteNonQuery (System.IAsyncResult asyncResult) [0x00022] in <8d7380b3d3cf4bd8be324c584f371b44>:0
at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlCommand.EndExecuteNonQuery(System.IAsyncResult)
at Oxide.Core.MySql.Libraries.MySql+MySqlQuery.Handle () [0x000f2] in <91888574617241c88465707c5df63fd9>:0As you know, for creating multiline stored func/proc you need to change default DELIMITER ";" to "$$", "//"...
Can oxide change DELIMITER?
Code from C# plugin:
mySql.ExecuteNonQuery(Core.Database.Sql.Builder.Append("DELIMITER $$"), ConnectionSQL); //return a error above
mySql.ExecuteNonQuery(Core.Database.Sql.Builder.Append("DELIMITER //"), ConnectionSQL);//same
mySql.ExecuteNonQuery(Core.Database.Sql.Builder.Append("CREATE TABLE Test(id INT UNSIGNED)"), ConnectionSQL);//works fine
Oxide.MySql.dll ver 2.0.3755.0