Steps to reproduce:
- Create a new instance without a database already created.
- Start a new instance, using a name of the database with a '-'.
- Database is created, dropping the '-'; ie: d8-2 becomes d82.
- The full database does not create.
Creates 25 tables:
show tables;
+------------------+
| Tables_in_d82 |
+------------------+
| batch |
| cache |
| cache_bootstrap |
| cache_config |
| cache_form |
| cache_menu |
| cache_page |
| cache_path |
| cache_tags |
| config_snapshot |
| flood |
| key_value |
| key_value_expire |
| menu_router |
| queue |
| role_permission |
| router |
| semaphore |
| sequences |
| sessions |
| url_alias |
| users |
| users_data |
| users_roles |
| variable |
+------------------+
25 rows in set (0.00 sec)
Error received: Fatal error: Class 'Drupal\Core\Database\DatabaseNotFoundException' not found in /my_site/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php on line 142
Call Stack
#TimeMemoryFunctionLocation10.0001643280{main}( )../install.php:020.00221387824install_drupal( )../install.php:3630.00221392912install_begin_request( )../install.core.inc:8440.02166892216install_verify_database_settings( )../install.core.inc:30250.02166892312install_database_errors( )../install.core.inc:94460.02407447304db_run_tasks( )../install.core.inc:107770.02407447864Drupal\Core\Database\Install\Tasks->runTasks( )../install.inc:94980.02407447864Drupal\Core\Database\Driver\mysql\Install\Tasks->connect( )../Tasks.php:12990.02647920008Drupal\Core\Database\Driver\mysql\Connection->createDatabase( )../Tasks.php:68
Need to check for "legal characters" in database name string.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal-1924278-3.patch | 554 bytes | dawehner |
#3 | 1924278_3.patch | 530 bytes | chx |
#1 | check-db-name.patch | 4.84 KB | marcingy |
Comments
Comment #1
marcingy CreditAttribution: marcingy commentedInitial stab at patch.
Comment #2
chx CreditAttribution: chx commentedThe reason for this fatal is that there is no DatabaseNotFoundException class in core. At all. We
use
it, wethrow
it, we try tocatch
it but it doesn't exist.Comment #3
chx CreditAttribution: chx commented#203955-41: Create database at installation time had it but #203955-46: Create database at installation time missed it. Here it is.
Comment #4
dawehnerCopied the exception, which was forgot to introduce in the other issue: #203955: Create database at installation time
Comment #6
dawehner#4: drupal-1924278-3.patch queued for re-testing.
Comment #7
chx CreditAttribution: chx commentedMine is better cos it does not do
use RuntimeException
-- didnt we agree on notuse
ing root classes?Comment #8
dawehnerYeah right, well it still a bit odd.
RTBC patch from #3, sorry for the cross-patch.
Comment #9
webchickOops. :) Good catch!
Committed and pushed to 8.x. Thanks!