mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 577 forks source link

Implicit conversion from data type char to varbinary(max) is not allowed. Use the CONVERT function to run this query. #450

Closed DPineault closed 4 years ago

DPineault commented 4 years ago

I've switched from running off of a MySQL back-end to Azure and now I receive the following error

SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Implicit conversion from data type char to varbinary(max) is not allowed. Use the CONVERT function to run this query. The SQL being executed was: INSERT INTO [auth_item] ([name], [type], [description], [rule_name], [data], [created_at], [updated_at]) VALUES ('Employee-Admin', 2, NULL, NULL, NULL, 1602328592, 1602328592)

Pointing to: 1 .in D:\home\site\vendor\yiisoft\yii2\db\Schema.php at line 664

  1. in D:\home\site\vendor\yiisoft\yii2\db\Command.php at line 1263 – yii\db\Schema::convertException(PDOException, 'INSERT INTO [auth_item] ([name],...')
  2. in D:\home\site\vendor\yiisoft\yii2\db\Command.php at line 1075 – yii\db\Command::internalExecute('INSERT INTO [auth_item] ([name],...')
  3. in D:\home\site\vendor\yiisoft\yii2\rbac\DbManager.php at line 283 – yii\db\Command::execute()
  4. in D:\home\site\vendor\yiisoft\yii2\rbac\BaseManager.php at line 133 – yii\rbac\DbManager::addItem(yii\rbac\Permission)
  5. in D:\home\site\vendor\mdmsoft\yii2-admin\models\AuthItem.php at line 173 – yii\rbac\BaseManager::add(yii\rbac\Permission)
  6. in D:\home\site\vendor\mdmsoft\yii2-admin\components\ItemController.php at line 79 – mdm\admin\models\AuthItem::save()
  7. mdm\admin\components\ItemController::actionCreate()
  8. in D:\home\site\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([mdm\admin\controllers\PermissionController, 'actionCreate'], [])
  9. in D:\home\site\vendor\yiisoft\yii2\base\Controller.php at line 157 – yii\base\InlineAction::runWithParams(['r' => 'admin/permission/create'])
  10. in D:\home\site\vendor\yiisoft\yii2\base\Module.php at line 528 – yii\base\Controller::runAction('create', ['r' => 'admin/permission/create'])
  11. in D:\home\site\vendor\yiisoft\yii2\web\Application.php at line 103 – yii\base\Module::runAction('admin/permission/create', ['r' => 'admin/permission/create'])
  12. in D:\home\site\vendor\yiisoft\yii2\base\Application.php at line 386 – yii\web\Application::handleRequest(yii\web\Request)
  13. in D:\home\site\wwwroot\admin\index.php at line 17 – yii\base\Application::run()

Can anyone offer any guidance to resolve this issue.

Thank you.

DPineault commented 4 years ago

Upgrading Yii resolved the issue.