Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F803905
D481.id1233.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 9:00 AM
Size
3 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 9:00 AM (7 h, 51 m)
Engine
blob
Format
Raw Data
Handle
576628
Attached To
D481: INP-1873 - Support MySQL 8 database collations
D481.id1233.diff
View Options
Index: core/install.php
===================================================================
--- core/install.php
+++ core/install.php
@@ -546,6 +546,17 @@
// 2. check permissions, that use have in this database
$status = $this->CheckDatabase(($this->currentStep == 'db_config') && !$this->GetVar('UseExistingSetup'));
+
+ if ( $status ) {
+ $db_collation = $this->toolkit->systemConfig->get('DBCollation', 'Database');
+ $sql = 'SHOW COLLATION LIKE ' . $this->Conn->qstr($db_collation);
+ $db_collation_data = $this->Conn->Query($sql);
+
+ if ( !is_array($db_collation_data) || !$db_collation_data ) {
+ $status = false;
+ $this->errorMessage = 'Please choose another Database Collation';
+ }
+ }
break;
case 'select_license':
Index: core/install/step_templates/db_config.tpl
===================================================================
--- core/install/step_templates/db_config.tpl
+++ core/install/step_templates/db_config.tpl
@@ -48,11 +48,16 @@
<td align="left">
<select name="DBCollation" class="text">
<?php
- $option_tpl = '<option value="%1$s"%2$s>%1$s</option>'."\n";
- $collations = Array ('utf8_general_ci', 'latin1_swedish_ci');
- foreach ($collations as $collation) {
- $selected = ($collation == $this->toolkit->systemConfig->get('DBCollation', 'Database')) ? ' selected="selected"' : '';
- echo sprintf($option_tpl, $collation, $selected);
+ $option_tpl = '<option value="%1$s"%3$s>%2$s</option>'."\n";
+ $collations = Array (
+ 'utf8_general_ci' => 'utf8_general_ci (MySQL 5.x)',
+ 'utf8mb3_general_ci' => 'utf8mb3_general_ci (MySQL 8.x+)',
+ 'utf8mb4_general_ci' => 'utf8mb4_general_ci (MySQL 8.x+)',
+ 'latin1_swedish_ci' => 'latin1_swedish_ci (MySQL 5.x & MySQL 8.x+)',
+ );
+ foreach ($collations as $collation_key => $collation_title) {
+ $selected = ($collation_key == $this->toolkit->systemConfig->get('DBCollation', 'Database')) ? ' selected="selected"' : '';
+ echo sprintf($option_tpl, $collation_key, $collation_title, $selected);
}
?>
</select>
@@ -74,4 +79,4 @@
<input type="radio" name="UseExistingSetup" id="UseExistingSetup_1" value="1"/> <label for="UseExistingSetup_1">Yes</label> <input type="radio" name="UseExistingSetup" id="UseExistingSetup_0" value="0" checked/> <label for="UseExistingSetup_0">No</label>
</td>
</tr>
-<?php } ?>
\ No newline at end of file
+<?php } ?>
Index: core/install/step_templates/db_reconfig.tpl
===================================================================
--- core/install/step_templates/db_reconfig.tpl
+++ core/install/step_templates/db_reconfig.tpl
@@ -48,11 +48,16 @@
<td align="left">
<select name="DBCollation" class="text">
<?php
- $option_tpl = '<option value="%1$s"%2$s>%1$s</option>'."\n";
- $collations = Array ('utf8_general_ci', 'latin1_swedish_ci');
- foreach ($collations as $collation) {
- $selected = ($collation == $this->toolkit->systemConfig->get('DBCollation', 'Database')) ? ' selected="selected"' : '';
- echo sprintf($option_tpl, $collation, $selected);
+ $option_tpl = '<option value="%1$s"%3$s>%2$s</option>'."\n";
+ $collations = Array (
+ 'utf8_general_ci' => 'utf8_general_ci (MySQL 5.x)',
+ 'utf8mb3_general_ci' => 'utf8mb3_general_ci (MySQL 8.x+)',
+ 'utf8mb4_general_ci' => 'utf8mb4_general_ci (MySQL 8.x+)',
+ 'latin1_swedish_ci' => 'latin1_swedish_ci (MySQL 5.x/8.x+)',
+ );
+ foreach ($collations as $collation_key => $collation_title) {
+ $selected = ($collation_key == $this->toolkit->systemConfig->get('DBCollation', 'Database')) ? ' selected="selected"' : '';
+ echo sprintf($option_tpl, $collation_key, $collation_title, $selected);
}
?>
</select>
@@ -64,4 +69,4 @@
<td align="left">
<input type="text" name="TablePrefix" class="text" maxlength="7" value="<?php echo $this->toolkit->systemConfig->get('TablePrefix', 'Database'); ?>" />
</td>
-</tr>
\ No newline at end of file
+</tr>
Event Timeline
Log In to Comment