Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Table 'mysql.proc' doesn't exist" when creating stored procedure #12

Open
dario-javier-rick opened this issue Sep 19, 2017 · 3 comments

Comments

@dario-javier-rick
Copy link

dario-javier-rick commented Sep 19, 2017

Hello,

I tried to create a stored procedure and it gaves me the following error

2017-09-19T03:22:02.0367327Z ##[error]Error Message:
2017-09-19T03:22:02.0367327Z ##[error] Initialization method ControlAcceso.Models.BLL.Tests.DatabaseTests.TestInitialize threw exception. MySql.Data.MySqlClient.MySqlException: MySql.Data.MySqlClient.MySqlException: Table 'mysql.proc' doesn't exist.
2017-09-19T03:22:02.0367327Z ##[error]Stack Trace:
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters)
2017-09-19T03:22:02.0377323Z ##[error] at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(String connectionString, String commandText, MySqlParameter[] parms)
2017-09-19T03:22:02.0377323Z ##[error] at ControlAcceso.Models.BLL.Tests.DatabaseTests.LevantarInstanciaMySQL() in d:\a\1\s\src\ControlAccesos\ControlAccesos.Tests\Database\DatabaseTests.cs:line 233
2017-09-19T03:22:02.0377323Z ##[error] at ControlAcceso.Models.BLL.Tests.DatabaseTests.TestInitialize() in d:\a\1\s\src\ControlAccesos\ControlAccesos.Tests\Database\DatabaseTests.cs:line 216

This is how I try to create it. The first two scripts are the ones that create the database and insert records in it

` MySqlServer dbServer = MySqlServer.Instance;
dbServer.StartServer();

        //Creo la DB y la selecciono
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), string.Format("CREATE DATABASE {0};USE {0};", TestDatabase));

        //Ejecuto los scripts para crear las tablas llenarla de datos
        string directorio = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\ControlAccesos\Models\ControlAccesos.edmx.sql"));
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\Scripts DB\Inserts.sql"));
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\Scripts DB\SP_ValidarAcceso.sql"));`

Thanks

@wlindsay
Copy link

I got the exact same problem while trying a procedure.

@williamlindsay
Copy link

williamlindsay commented Dec 1, 2017

I've forked the repo with a fix for this (https://github.com/williamlindsay/MySql.Server). The solution involved updating MySQL to 5.7.20 and use the initialization process to setup those base tables which wouldn't be there otherwise. All that is needed is to set the new initialize flag to true when calling StartServer. That said, it does slow the process down so I would recommend to only run StartServer once per full test suite execution and clear the tables in between tests instead.

@tommymonk
Copy link

Has there been any change on this issue, it still seems broken in the same way on 1.1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@tommymonk @wlindsay @dario-javier-rick @williamlindsay and others