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

In version 3.1.1, the generated mysql script was fine on the 8.0+ mysql version, but failed on the 32-bit version of MySQL5.7.30 #1108

Closed
guaicaiboshi opened this issue Jun 17, 2020 · 4 comments

Comments

@guaicaiboshi
Copy link

guaicaiboshi commented Jun 17, 2020

In version 3.1.1, the generated mysql script was fine on the 8.0+ mysql version, but failed on the 32-bit version of MySQL5.7.30

E:\install script\SensorBroker.Migrator>SensorBroker.Migrator.exe
2020-06-17 13:30:37 | Host database: server=127.0.0.1;port=3306;database=******;uid=*****;password=*****;pooling=True;connect timeout=10;default command timeout=60;sslmode=none;charset=utf8;allowpublickeyretrieval=True
2020-06-17 13:30:37 | Continue to migration for this host database and all tenants..? (Y/N): y
2020-06-17 13:30:40 | HOST database migration started...
2020-06-17 13:30:43 | An error occured during migration of host database:
2020-06-17 13:30:43 | MySql.Data.MySqlClient.MySqlException (0x80004005): 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 'COLUMN `VMCSerialPortId` TO `SerialPortId`' at line 1
 ---> MySql.Data.MySqlClient.MySqlException (0x80004005): 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 'COLUMN `VMCSerialPortId` TO SerialPortId`' at line 1
   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ResultSet.cs:line 49
   at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 125
   at MySql.Data.MySqlClient.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 390
   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\Core\CommandExecutor.cs:line 62
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 226
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 74
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(StringtargetMigration)
   at Pomelo.EntityFrameworkCore.MySql.Migrations.Internal.MySqlMigrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
   at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrate(AbpTenantBase tenant, Action`1 seedAction)
   at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrateForHost(Action`1 seedAction)
   at SensorBroker.Migrator.MultiTenantMigrateExecuter.Run(Boolean skipConnVerification)
2020-06-17 13:30:43 | Canceled migrations.

Further technical details

MySQL version: 5.7.30
Operating system: win7 x86
Pomelo.EntityFrameworkCore.MySql version:3.1.1
Microsoft.AspNetCore.App version:.netCore3.1

Other details about my project setup:
An error was reported on the Windows 7 x86 machine when the initialization database script was executed

@guaicaiboshi
Copy link
Author

guaicaiboshi commented Jun 17, 2020

This is running on a Win10 x64 machine without any exceptions, and the mysql database version is 8.0.16.

This is running on a Win10 x64 machine without any exceptions, and the mysql database version is 8.0.16.
2020-06-17 13:22:36 | Host database: server=127.0.0.1;port=3306;database=******;uid=*****;password=*****;pooling=True;connect timeout=10;default command timeout=60;sslmode=none;charset=utf8;allowpublickeyretrieval=True
2020-06-17 13:22:36 | Continue to migration for this host database and all tenants..? (Y/N): y
2020-06-17 13:22:40 | HOST database migration started...
2020-06-17 13:25:41 | HOST database migration completed.
2020-06-17 13:25:41 | --------------------------------------------------------
2020-06-17 13:25:41 | All databases have been migrated.
Press ENTER to exit...

@guaicaiboshi
Copy link
Author

Early. I am using netCore2.2, corresponding is Pomelo EntityFrameworkCore. MySql version 2.2.6, test is no problem, now. NetCore2.2 upgrading to. NetCore3.1, Pomelo. EntityFrameworkCore. 2.2.6 MySql version upgrade to 3.1.1, is wrong.

@lauxjpn
Copy link
Collaborator

lauxjpn commented Jun 17, 2020

Make sure that you set the ServerVersion() accordingly. Take a look at our sample.

Pomelo 3.x uses newer features of newer MySQL/MariaDB versions. And if you don't specify the server version explicitly, the newest one (and MySQL) will be assumed.

@lauxjpn lauxjpn self-assigned this Jun 17, 2020
@guaicaiboshi
Copy link
Author

Make sure that you set the ServerVersion() accordingly. Take a look at our sample.

Pomelo 3.x uses newer features of newer MySQL/MariaDB versions. And if you don't specify the server version explicitly, the newest one (and MySQL) will be assumed.

Thank you very much for your help so that the problem can be solved quickly.

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

No branches or pull requests

2 participants