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

New Feature: allow choosing innoDb vs MyIsam engine for MYSQL during installation #1043

Merged
merged 122 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from 119 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
72e3ccf
add dbengine to InstallerConfigurationForm
TonisOrmisson Jan 3, 2018
e10438b
DEV add InnoDB support: installer: getDbEngines
TonisOrmisson Jan 3, 2018
0303297
DEV add InnoDB support: installer: label comes from Model!
TonisOrmisson Jan 3, 2018
81c7959
DEV add InnoDB support: installer: 'required' comes from Model! 'cont…
TonisOrmisson Jan 3, 2018
8923a65
DEV add InnoDB support: installer: form JS
TonisOrmisson Jan 3, 2018
2754791
DEV add InnoDB support: installer: engine validation
TonisOrmisson Jan 3, 2018
06121c6
DEV add InnoDB support: installer: setMySQLDefaultEngine
TonisOrmisson Jan 3, 2018
4d0af89
DEV add InnoDB support: remove ALL references to engines
TonisOrmisson Jan 3, 2018
cc6575a
DEV add InnoDB support: make engine selection work
TonisOrmisson Jan 3, 2018
9c466b8
DEV add InnoDB support: make engine selection work
TonisOrmisson Jan 3, 2018
d5abf2b
SHOW ALL ERRORS (INSTALLATION DEBUG)
TonisOrmisson Jan 4, 2018
142341d
relocate dbEngine
TonisOrmisson Jan 4, 2018
4f80d36
relocate dbEngine
TonisOrmisson Jan 4, 2018
2785577
typo
TonisOrmisson Jan 4, 2018
8d0a4fe
Merge commit '72e3ccf' into develop-innodb
TonisOrmisson Feb 1, 2018
8882293
Merge commit 'e10438b' into develop-innodb
TonisOrmisson Feb 1, 2018
4fd63c8
Merge commit '0303297' into develop-innodb
TonisOrmisson Feb 1, 2018
e1e9c90
Merge commit '81c7959' into develop-innodb
TonisOrmisson Feb 1, 2018
a8bf4be
Merge commit '8923a65' into develop-innodb
TonisOrmisson Feb 1, 2018
513d4c3
Merge commit '2754791' into develop-innodb
TonisOrmisson Feb 1, 2018
6a96c09
Merge commit '06121c6' into develop-innodb
TonisOrmisson Feb 1, 2018
5f1749e
Merge commit '4d0af89' into develop-innodb
TonisOrmisson Feb 1, 2018
7cc06be
Merge commit 'cc6575a' into develop-innodb
TonisOrmisson Feb 1, 2018
1372fd7
Merge commit '9c466b8' into develop-innodb
TonisOrmisson Feb 1, 2018
919000b
Merge commit 'd5abf2b' into develop-innodb
TonisOrmisson Feb 1, 2018
62ff3b4
Merge commit '142341d' into develop-innodb
TonisOrmisson Feb 1, 2018
397c31d
Merge commit '4f80d36' into develop-innodb
TonisOrmisson Feb 1, 2018
f74fd7b
Merge commit '2785577' into develop-innodb
TonisOrmisson Feb 1, 2018
c572c8b
DEV: innodb support: test change travis config
TonisOrmisson Feb 1, 2018
7a97bee
DEV: innodb support: shorten surveyls_title
TonisOrmisson Feb 1, 2018
ffd84e4
DEV: innodb support: typo
TonisOrmisson Feb 1, 2018
eef2b64
DEV: innodb support: shorten users-email
TonisOrmisson Feb 1, 2018
53fa2ce
DEV: innodb support: revert shortening
TonisOrmisson Feb 1, 2018
78d941f
DEV: innodb support: show travis db config
TonisOrmisson Feb 1, 2018
22dd78d
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
94db20b
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
2d7d192
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
7785a92
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
dba8d86
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
0083032
DEV: innodb support: set dynamic row format
TonisOrmisson Feb 1, 2018
bccccc2
DEV: innodb support: add options to create-database
TonisOrmisson Feb 1, 2018
f2f69f6
DEV: innodb support: frmove default_row_format
TonisOrmisson Feb 1, 2018
e1dd419
DEV: innodb support: frmove default_row_format typo
TonisOrmisson Feb 1, 2018
c1f9eab
DEV: innodb support: run all tests
TonisOrmisson Feb 1, 2018
ff3fd1e
DEV: innodb support: remove skip tests
TonisOrmisson Feb 1, 2018
8bad74d
DEV: innodb support: do all tests
TonisOrmisson Feb 1, 2018
7744b76
DEV: innodb support: remove dynamic row format
TonisOrmisson Apr 6, 2018
68f1119
Merge remote-tracking branch 'upstream/develop' into develop-innodb
TonisOrmisson Apr 7, 2018
e1a85e1
upload artifacts
TonisOrmisson Apr 7, 2018
faf258d
upload artifacts2
TonisOrmisson Apr 7, 2018
8296a89
set MyiSam as default engine for mysql
TonisOrmisson Apr 7, 2018
8687fe1
upload screenshots
TonisOrmisson Apr 7, 2018
57092d8
wait for items to be clickable
TonisOrmisson Apr 7, 2018
b25a382
FIX : remove createSurveyTest close notifications (fails tests)
TonisOrmisson Apr 13, 2018
8362e37
send artifacts to s3, debug
TonisOrmisson Apr 13, 2018
53520ed
fix artifacts path
TonisOrmisson Apr 13, 2018
05af9d1
wait for items to be clickable
TonisOrmisson Apr 13, 2018
1e3429c
title
TonisOrmisson Apr 13, 2018
c713663
revert createSurveyTest
TonisOrmisson Apr 13, 2018
f5097d8
DEV: test with InnoDB
TonisOrmisson Apr 13, 2018
968ca15
DEV: remove travis innodb config changes
TonisOrmisson Apr 13, 2018
eef0ea1
DEV: test installation innodb
TonisOrmisson Apr 13, 2018
be6b7c5
DEV: put back travis InnoDB config
TonisOrmisson Apr 13, 2018
155e4c0
DEV test only large_file_prefix
TonisOrmisson Apr 13, 2018
1ce2ee7
DEV: put back Barracuda file format
TonisOrmisson Apr 13, 2018
3eac29e
DEV run tests both MyIsam & InnoDb
TonisOrmisson Apr 14, 2018
6b7deb9
DEV test also PHP 7.2
TonisOrmisson Apr 14, 2018
ae6eb25
Use model AttributeHints in form
TonisOrmisson Apr 14, 2018
fcc1a65
DEV Add innoDb alert in installation form
TonisOrmisson Apr 14, 2018
8f9a7b8
DEV let InstallerConfigForm do the db connection
TonisOrmisson Apr 14, 2018
ea4e4a7
wait for items to be clickable
TonisOrmisson Apr 14, 2018
cd2f1a3
installer errors
TonisOrmisson Apr 14, 2018
c5ecb97
no errors!
TonisOrmisson Apr 15, 2018
5a1a557
DEV: add createDatabase to installerform
TonisOrmisson Apr 15, 2018
e54e15b
remove _setup_tables from controller (moved to model)
TonisOrmisson Apr 15, 2018
1ef0909
clean up InstallerController from things moved to InstallerController…
TonisOrmisson Apr 15, 2018
82580fe
fix connection
TonisOrmisson Apr 15, 2018
95fc416
fix missing database name in Tests
TonisOrmisson Apr 16, 2018
8c122fa
fix missing return
TonisOrmisson Apr 16, 2018
65e923a
shorten test matrix (temp)
TonisOrmisson Apr 16, 2018
08b9e26
remove assert in wrong place
TonisOrmisson Apr 16, 2018
160557f
fix inst->connection inst->db
TonisOrmisson Apr 16, 2018
807ea19
DEV: refactor pre-installation check
TonisOrmisson Apr 16, 2018
77a085b
DEV: remove custom erroor conf
TonisOrmisson Apr 16, 2018
3dd74c3
DEV: remove loadhelper loadlibrary
TonisOrmisson Apr 16, 2018
bda9079
DEV: move _executeSQLFile to Tests (the only place used)
TonisOrmisson Apr 16, 2018
874a634
DEV: use variable connection
TonisOrmisson Apr 16, 2018
7dda7ce
DEV: rename installer dbsettings_view -> populatedb_view
TonisOrmisson Apr 16, 2018
fc8a37c
DEV: fix installer views
TonisOrmisson Apr 16, 2018
2e99eff
DEV: fix some issues in InstallerConfigForm
TonisOrmisson Apr 16, 2018
91bdbfb
DEV: InstallerConfigForm: simplify getDbPort()
TonisOrmisson Apr 16, 2018
f33b4c2
DEV: InstallerConfigForm: simplify getDbPort() 2
TonisOrmisson Apr 16, 2018
b1612fe
DEV: InstallerConfigForm: remove filename param from setupTables() on…
TonisOrmisson Apr 16, 2018
5019d0b
DEV: InstallerConfigForm: fix populate
TonisOrmisson Apr 16, 2018
71ddffb
DEV: InstallerConfigForm: fix populate
TonisOrmisson Apr 17, 2018
d1df744
DEV: InstallerConfigForm: use dynamic engine for installationTest
TonisOrmisson Apr 17, 2018
07bb46b
DEV: InstallerConfigForm: simplify constructor
TonisOrmisson Apr 17, 2018
c36e5cb
DEV: InstallerConfigForm: simplify model
TonisOrmisson Apr 17, 2018
acd6e2f
DEV: InnoDb: run all tests
TonisOrmisson Apr 17, 2018
ac36ccc
Merge branch 'develop' into develop-innodb
TonisOrmisson Apr 17, 2018
7ad48c0
DEV: InnoDb: fix wrong static call
TonisOrmisson Apr 17, 2018
984e359
DEV: InnoDb: 'pdo' is a requirement, simplify Model
TonisOrmisson Apr 17, 2018
aa07635
Scrutinizer Auto-Fixes
scrutinizer-auto-fixer Apr 17, 2018
a832eae
Merge pull request #14 from LimeSurvey/scrutinizer-patch-1
TonisOrmisson Apr 17, 2018
a9e96c3
DEV: InnoDb: clear session from installation connection info after su…
TonisOrmisson Apr 18, 2018
852eb70
Merge remote-tracking branch 'origin/develop-innodb' into develop-innodb
TonisOrmisson Apr 18, 2018
531b110
merge upstream/develop
TonisOrmisson Apr 18, 2018
11f5137
merge upstream/develop
TonisOrmisson Apr 18, 2018
e66e2a9
Merge remote-tracking branch 'upstream/develop' into develop-innodb
TonisOrmisson Apr 20, 2018
998fc76
Resolve conflicts & sync with upstream/develop (WIP)
TonisOrmisson Jan 19, 2019
4d9d347
DEV: fix installer process
TonisOrmisson Jan 19, 2019
f84ea7f
DEV: use password input for db password
TonisOrmisson Jan 19, 2019
987a01a
Remove Traits
TonisOrmisson Jan 22, 2019
8c6b840
DEV: remove screenshots upload to AWS from travis conf
TonisOrmisson Jan 22, 2019
99bbc92
merge upstream
TonisOrmisson Mar 21, 2019
36d5262
save engine in config, use it during survey activation
TonisOrmisson Mar 21, 2019
595de7f
fix mysql db engine for Tokens table
TonisOrmisson Mar 22, 2019
1c663c5
fix mysql db engine for activate_helper (is it used?)
TonisOrmisson Mar 22, 2019
5e24ba2
fix mysql db engine for AuditLog
TonisOrmisson Mar 22, 2019
1116599
merge upstream
TonisOrmisson Mar 28, 2019
c330470
Merge remote-tracking branch 'upstream/develop' into develop-innodb
TonisOrmisson Apr 4, 2019
d653fea
Merge branch 'develop' into develop-innodb
dominikvitt Apr 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
language: php
php:
- 7.2
env:
- DBENGINE=MYISAM
- DBENGINE=INNODB

notifications:
email:
Expand All @@ -31,6 +34,17 @@ before_script:
- chmod -R 777 upload
- chmod -R 777 themes # Need 777 so both console and web server can cd into the folder.
- chmod -R 777 tests/tmp
# InnoDb needs large_file_prefix & Barracuda file format
# https://discuss.gogs.io/t/solved-mysql-error-1064-while-running-first-install/1604
- mysql -uroot -e "Show variables like '%large%';"
- mysql -uroot -e "SET @@global.innodb_large_prefix = 1;"
- mysql -uroot -e "SET @@global.innodb_file_format = Barracuda;"
- mysql -uroot -e "SET @@global.innodb_file_format_max = Barracuda;"

- mysql -uroot -e "Show variables like '%large%';"
- mysql -uroot -e "Show variables like '%innodb_file%';"
- mysql -uroot -e "Show variables like '%innodb_default%';"

- php application/commands/console.php install admin password TravisLS no@email.com verbose
- cp application/config/config-sample-mysql.php application/config/config.php
# Enable debug=2 in config file. OBS: This assumes debug is on line 61.
Expand Down
10 changes: 10 additions & 0 deletions application/commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ protected function createDatabase()
$this->output('Creating database...');
App()->configure(array('components'=>array('db'=>array('autoConnect'=>false))));
$this->connection = App()->db;


App()->configure(array('components'=>array('db'=>array('autoConnect'=>true))));
$connectionString = $this->connection->connectionString;
$this->output($connectionString);
Expand All @@ -115,6 +117,14 @@ protected function createDatabase()
}

$sDatabaseName = $this->getDBConnectionStringProperty('dbname', $connectionString);
$dbEngine = getenv('DBENGINE');

if (!empty($this->connection) && $this->connection->driverName == 'mysql') {
$this->connection
->createCommand(new CDbExpression(sprintf('SET default_storage_engine=%s;', $dbEngine)))
->execute();
}

try {
switch ($this->connection->driverName) {
case 'mysqli':
Expand Down
838 changes: 148 additions & 690 deletions application/controllers/InstallerController.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion application/core/db/MysqlSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct($conn)
public function createTable($table, $columns, $options = null)
{
if (empty($options)) {
$options = 'ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci';
$options = 'DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci';
}

// Below copied from parent.
Expand Down
7 changes: 5 additions & 2 deletions application/helpers/admin/activate_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,13 @@ function activateSurvey($iSurveyID, $simulate = false)

$aTableDefinition = array();
$bCreateSurveyDir = false;
$options = '';
// Specify case sensitive collations for the token
$sCollation = '';
if (Yii::app()->db->driverName == 'mysqli' || Yii::app()->db->driverName == 'mysql') {
$sCollation = " COLLATE 'utf8mb4_bin'";
$options .= sprintf(" ENGINE = %s ", Yii::app()->getConfig('mysqlEngine'));

}
if (Yii::app()->db->driverName == 'sqlsrv' || Yii::app()->db->driverName == 'dblib' || Yii::app()->db->driverName == 'mssql') {
$sCollation = " COLLATE SQL_Latin1_General_CP1_CS_AS";
Expand Down Expand Up @@ -459,7 +462,7 @@ function activateSurvey($iSurveyID, $simulate = false)
$sTableName = "{{survey_{$iSurveyID}}}";
Yii::app()->loadHelper("database");
try {
Yii::app()->db->createCommand()->createTable($sTableName, $aTableDefinition);
Yii::app()->db->createCommand()->createTable($sTableName, $aTableDefinition, $options);
Yii::app()->db->schema->getTable($sTableName, true); // Refresh schema cache just in case the table existed in the past
} catch (CDbException $e) {
if (App()->getConfig('debug')) {
Expand Down Expand Up @@ -509,7 +512,7 @@ function activateSurvey($iSurveyID, $simulate = false)

$sTableName = "{{survey_{$iSurveyID}_timings}}";
try {
Yii::app()->db->createCommand()->createTable($sTableName, $aTimingTableDefinition);
Yii::app()->db->createCommand()->createTable($sTableName, $aTimingTableDefinition, $options);
Yii::app()->db->schema->getTable($sTableName, true); // Refresh schema cache just in case the table existed in the past
} catch (CDbException $e) {
return array('error'=>'timingstablecreation');
Expand Down
1 change: 1 addition & 0 deletions application/models/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function attributeLabels()
);
}


/**
* Retrieves a list of models based on the current search/filter conditions.
*
Expand Down
Loading