Updated validate to detect lower case tables + added support for checking mariadb 10.2 timestamps (#6928)

* Updated validate to detect lower case tables + added support for checking mariadb 10.2 timestamps

* updated install docs
This commit is contained in:
Neil Lathwood 2017-07-03 21:46:45 +01:00 committed by Tony Murray
parent 20b08cf595
commit 573a4b0e62
5 changed files with 16 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Within the [mysqld] section please add:
```bash
innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0
```
```

View File

@ -27,6 +27,7 @@ Within the [mysqld] section please add:
```bash
innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0
```
```

View File

@ -27,6 +27,7 @@ Within the [mysqld] section please add:
```bash
innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0
```
```systemctl restart mysql```

View File

@ -27,6 +27,7 @@ Within the [mysqld] section please add:
```bash
innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0
```
```systemctl restart mysql```

View File

@ -174,6 +174,12 @@ if (str_contains($strict_mode, 'STRICT_TRANS_TABLES')) {
//print_fail('You have MySQL STRICT_TRANS_TABLES enabled, please disable this until full support has been added: https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html');
}
// Test for lower case table name support
$lc_mode = dbFetchCell("SELECT @@global.lower_case_table_names");
if ($lc_mode != 0) {
print_fail('You have lower_case_table_names set to 1 or true in mysql config.', 'Set lower_case_table_names=0 in your mysql config file');
}
if (empty($strict_mode) === false) {
print_fail("You have not set sql_mode='' in your mysql config");
}
@ -215,6 +221,12 @@ if (is_file('misc/db_schema.yaml')) {
$previous_column = '';
foreach ($data['Columns'] as $column => $cdata) {
$cur = $current_schema[$table]['Columns'][$column];
if ($cur['Default'] == 'current_timestamp()') {
$cur['Default'] = 'CURRENT_TIMESTAMP';
}
if ($cur['Extra'] == 'on update current_timestamp()') {
$cur['Extra'] = 'on update CURRENT_TIMESTAMP';
}
if (empty($current_schema[$table]['Columns'][$column])) {
print_fail("Database: missing column ($table/$column)");