File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class MySQL extends SqlBase
1515 * @param array<string, mixed> $config The config array from the connection object
1616 * @param \Cake\Database\Driver\Mysql $driver The current mysql driver instance
1717 */
18- public function __construct (array $ config , MysqlDriver $ driver )
18+ public function __construct (array $ config , protected MysqlDriver $ driver )
1919 {
2020 parent ::__construct ($ config );
2121
@@ -42,8 +42,14 @@ public function dump(): string
4242 '--host= ' . ($ this ->config ['host ' ] ?? 'localhost ' ),
4343 '--databases ' ,
4444 $ this ->config ['database ' ],
45- '--no-create-db ' ,
4645 ];
46+
47+ if ($ this ->driver ->isMariadb ()) {
48+ $ command [] = '--skip-create-options ' ;
49+ } else {
50+ $ command [] = '--no-create-db ' ;
51+ }
52+
4753 if ($ this ->isDataOnly ()) {
4854 $ command [] = '--no-create-info ' ;
4955 }
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public function testCommand(): void
4747 $ this ->assertOutputContains ('INSERT INTO posts VALUES( ' );
4848 } elseif ($ this ->isDBType (Mysql::class)) {
4949 var_dump ($ this ->_out ->messages ());
50+ var_dump ($ this ->_err ->messages ());
5051 $ this ->assertOutputContains ('CREATE TABLE `posts` ( ' );
5152 $ this ->assertOutputContains ('INSERT INTO `posts` VALUES ( ' );
5253 } elseif ($ this ->isDBType (Postgres::class)) {
You can’t perform that action at this time.
0 commit comments