Task #41151

Improve error message for failling database creation

Added by Nicole Cordes about 8 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2012-09-21
Due date:
% Done:

100%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

Due to compatibility (maybe?) the create database command can't use quotes for new database names. Therefore (at least for MySQL databases) the characters to use is limited to 0-9, a-z, A-Z, $, _

This should be mentioned when creating the database fails.

Associated revisions

Revision d3a54feb (diff)
Added by Nicole Cordes about 8 years ago

[TASK] Database creating fails due to not allowed characters

Due to compatibility the CREATE DATABASE statement is used without quotes.
At least for MySQL databases there are limited characters allowed to use
in unquoted database names (0-9,a-z,A-Z$_). At the moment the database
name is parsed with enabled hyphen but this is obviously not allowed. The
parsing has to be changed to meet the MySQL limitation as well.

Change-Id: I24dcf99bb9baed6a4794183de0eb4f99a0948b7c
Resolves: #41151
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14812
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision f5c8da2f (diff)
Added by Jigal van Hemert about 8 years ago

[TASK] Database creating fails due to not allowed characters

Due to compatibility the CREATE DATABASE statement is used without quotes.
At least for MySQL databases there are limited characters allowed to use
in unquoted database names (0-9,a-z,A-Z$_). At the moment the database
name is parsed with enabled hyphen but this is obviously not allowed. The
parsing has to be changed to meet the MySQL limitation as well.

Change-Id: Id8e025e6c681487818973a595652dd29cb86c4b8
Resolves: #41151
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14897
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision bc3809c0 (diff)
Added by Jigal van Hemert about 8 years ago

[TASK] Database creating fails due to not allowed characters

Due to compatibility the CREATE DATABASE statement is used without quotes.
At least for MySQL databases there are limited characters allowed to use
in unquoted database names (0-9,a-z,A-Z$_). At the moment the database
name is parsed with enabled hyphen but this is obviously not allowed. The
parsing has to be changed to meet the MySQL limitation as well.

Change-Id: Id8e025e6c681487818973a595652dd29cb86c4b8
Resolves: #41151
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14898
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision 825a6d53 (diff)
Added by Jigal van Hemert about 8 years ago

[TASK] Database creating fails due to not allowed characters

Due to compatibility the CREATE DATABASE statement is used without quotes.
At least for MySQL databases there are limited characters allowed to use
in unquoted database names (0-9,a-z,A-Z$_). At the moment the database
name is parsed with enabled hyphen but this is obviously not allowed. The
parsing has to be changed to meet the MySQL limitation as well.

Change-Id: Id8e025e6c681487818973a595652dd29cb86c4b8
Resolves: #41151
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14899
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Markus Klein about 8 years ago

Hi!

Did you enter a database name with quotes? Or does TYPO3 quote somewhere where it is not appropriate?

#2 Updated by Nicole Cordes about 8 years ago

I tried to create a database typo3_6-0_blank. Self quoting is not allowed as the database name is parsed by preg_match('/[^[:alnum:]_-]/', $newDatabaseName)

The problem is the "-" which is not allowed in unquoted database names (see http://dev.mysql.com/doc/refman/5.1/en/identifiers.html)

#3 Updated by Gerrit Code Review about 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14812

#4 Updated by Markus Klein about 8 years ago

Why no just quoting the database name in general?

#5 Updated by Nicole Cordes about 8 years ago

This was discussed by some guys yesterday evening and we were not sure if other databases allow those `` quotes. So the safest way to support all database system was to stay unquoted.

#6 Updated by Markus Klein about 8 years ago

Ok

#7 Updated by Nicole Cordes about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Gerrit Code Review about 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14897

#9 Updated by Gerrit Code Review about 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/14898

#10 Updated by Gerrit Code Review about 8 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/14899

#11 Updated by Jigal van Hemert about 8 years ago

  • Status changed from Under Review to Resolved

#12 Updated by Gerrit Code Review about 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/15884

#13 Updated by Alexander Opitz over 7 years ago

Hi Nicole,

what is the state of the 4.7 fix?

#14 Updated by Wouter Wolters over 7 years ago

  • Status changed from Under Review to Resolved

4.7 gets only security fixes, closed.

#15 Updated by Riccardo De Contardi about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF