Skip to content

Commit 6a97e00

Browse files
committed
add Percona server to the platform
1 parent 90cd58e commit 6a97e00

File tree

22 files changed

+486
-93
lines changed

22 files changed

+486
-93
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ In the meantime, you can try out http://sqlfiddle.com/
2626
* MariaDB: 5.5, 10.0, 10.1, 10.2, 10.3, 10,4
2727
* Microsoft SQL Server: 2017.cu18, 2019.ga (on Linux)
2828
* Mysql: 5.5, 5.6, 5.7, 8.0
29+
* Percona Server for MySQL: 5.6, 5.7, 8.0
2930
* PostgreSQL: 9.4, 9.5, 9.6, 10.11, 11.6, 12.1
3031
* SQLite: 3.27
3132

app/config/services.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,36 @@ parameters:
130130
#server_version: '8.0'
131131
vendor: mysql
132132
version: '8.0'
133+
percona_5_6:
134+
host: percona_5_6
135+
port: 3306
136+
user: root
137+
password: '%env(MYSQL_ROOT_PASSWORD)%'
138+
#charset: UTF8
139+
#driver: pdo_mysql
140+
#server_version: '5.6'
141+
vendor: percona
142+
version: '5.6'
143+
percona_5_7:
144+
host: percona_5_7
145+
port: 3306
146+
user: root
147+
password: '%env(MYSQL_ROOT_PASSWORD)%'
148+
#charset: UTF8
149+
#driver: pdo_mysql
150+
#server_version: '5.7'
151+
vendor: percona
152+
version: '5.7'
153+
percona_8_0:
154+
host: percona_8_0
155+
port: 3306
156+
user: root
157+
password: '%env(MYSQL_ROOT_PASSWORD)%'
158+
#charset: UTF8
159+
#driver: pdo_mysql
160+
#server_version: '8.0'
161+
vendor: percona
162+
version: '8.0'
133163
# oracle...
134164
postgresql_9_4:
135165
host: postgresql_9_4

app/src/Core/DatabaseSchemaManager.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function getCreateDatabaseSqlAction($dbName, $userName, $password, $chars
4646

4747
case 'mariadb':
4848
case 'mysql':
49+
case 'percona':
50+
/// @todo if mysql version is bigger than 8.0, add `WITH mysql_native_password`
4951
$statements = [
5052
"CREATE DATABASE `$dbName`" . ($collation !== null ? " CHARACTER SET $collation" : '') . ';'
5153
];
@@ -121,6 +123,7 @@ public function getDropDatabaseSqlAction($dbName, $userName, $ifExists = false)
121123

122124
case 'mariadb':
123125
case 'mysql':
126+
case 'percona':
124127
$statements = [
125128
"DROP DATABASE {$ifClause} `$dbName`;"
126129
];
@@ -195,6 +198,7 @@ public function getDropUserSqlAction($userName, $ifExists = false)
195198

196199
case 'mariadb':
197200
case 'mysql':
201+
case 'percona':
198202
/// @todo since mysql 5.7, 'DROP USER IF EXISTS' is supported. We could use it...
199203
return new Command([
200204
"DROP USER '$userName'@'%';"
@@ -240,6 +244,7 @@ public function getListCollationsSqlAction()
240244

241245
case 'mariadb':
242246
case 'mysql':
247+
case 'percona':
243248
return new Command(
244249
'SHOW COLLATION;',
245250
function ($output, $executor) {
@@ -312,6 +317,7 @@ public function getListDatabasesSqlAction()
312317

313318
case 'mariadb':
314319
case 'mysql':
320+
case 'percona':
315321
return new Command(
316322
/// @todo use 'SHOW DATABASES' for versions < 5
317323
"SELECT SCHEMA_NAME AS 'Database' FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME;",
@@ -372,6 +378,7 @@ public function getListUsersSqlAction()
372378

373379
case 'mariadb':
374380
case 'mysql':
381+
case 'percona':
375382
return new Command(
376383
'SELECT DISTINCT User FROM mysql.user ORDER BY User;',
377384
function ($output, $executor) {
@@ -424,6 +431,7 @@ public function getRetrieveVersionInfoSqlAction()
424431

425432
case 'mariadb':
426433
case 'mysql':
434+
case 'percona':
427435
return new Command(
428436
'SHOW VARIABLES LIKE "version";',
429437
function ($output, $executor) {
@@ -499,6 +507,9 @@ protected function getCollationName($charset)
499507
case 'mysql':
500508
break;
501509

510+
case 'percona':
511+
break;
512+
502513
case 'mssql':
503514
if ($charset == 'utf8') {
504515
if (version_compare(

app/src/Core/SqlExecutor/Forked/NativeClient.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ protected function getDbClientType(array $connectionConfiguration)
157157
{
158158
$vendor = $connectionConfiguration['vendor'];
159159
return str_replace(
160-
array('mariadb', 'mssql', 'oracle', 'postgresql'),
161-
array('mysql', 'sqlcmd', 'sqlplus', 'psql'),
160+
array('mariadb', 'mssql', 'oracle', 'percona', 'postgresql'),
161+
array('mysql', 'sqlcmd', 'sqlplus', 'mysql', 'psql'),
162162
$vendor
163163
);
164164
}
@@ -174,6 +174,7 @@ public function resultSetToArray($string)
174174
switch ($this->databaseConfiguration['vendor']) {
175175
case 'mariadb':
176176
case 'mysql':
177+
case 'percona':
177178
// 'table format', triggered by using the -t option for the client
178179
// NB: both mariadb and mysql output no headers line when resultset has 0 rows
179180
$output = explode("\n", $string);

doc/TODO.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
## Major features
1818

19-
- add Percona server: 5.6, 5.7, 8.0
20-
2119
- allow to easily pick specific minor-versions for each db
2220

2321
- host: allow building/starting partial docker stack for speed and resources (eg. no oracle, no sqlserver,
@@ -84,6 +82,9 @@
8482

8583
## Improvements
8684

85+
- ms sql server: 'cuXX' should be treated as a point release is for other databases - there is no 'minor version' for it.
86+
Ie. rename 2017.cu18 to 2017 and 2019.ga to 2019
87+
8788
- add TOC to readme.md (see how it's done at fe. https://raw.githubusercontent.com/phpredis/phpredis/develop/README.markdown)
8889

8990
- improve handling output of 'select' queries
@@ -115,9 +116,6 @@
115116
+ add data dump capabilities
116117
+ add schema dump capabilities
117118

118-
- ms sql server: 'cuXX' should be treated as a point release is for other databases - there is no 'minor version' for it.
119-
Ie. rename 2017.cu18 to 2017 and 2019.ga to 2019
120-
121119
- build/docker:
122120
+ add composer HEALTHCHECK to containers, at least our own ones (see https://docs.docker.com/engine/reference/builder/#healthcheck)
123121
+ while setting up symfony, have the web site show up a courtesy page

doc/WHATSNEW.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Version 0.13
22
------------
33

4+
- New: added Percona Server 5.6, 5.7 and 8.0 to the available databases
5+
46
- New: Percona pt-toolkit is now installed in the worker container
57

68
- Improved: added the `-u` option to `dbstack.sh build`, to allow updating the base Docker images.
7-
This allows to easily upgrade the available databases to the latest releases found on dockerHub
9+
This can be used to easily upgrade the available databases to the latest release found on dockerHub
810

911
- Improved: upgraded bundled Adminer from 4.7.5 to 4.7.6
1012

docker/config/percona/5.6/big.cnf

Whitespace-only changes.

docker/config/percona/5.6/small.cnf

Whitespace-only changes.

docker/config/percona/5.7/big.cnf

Whitespace-only changes.

docker/config/percona/5.7/small.cnf

Whitespace-only changes.

0 commit comments

Comments
 (0)