Bug #67290
Translation of MySQL field types to other databases is incorrect
Status: | Resolved | Start date: | 2015-06-04 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | DBAL | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 7 | Is Regression: | No | |
PHP Version: | 5.6 | Sprint Focus: | ||
Complexity: |
Description
MySQL supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT specifies an INT with a display width of four digits. This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)
The display width does not constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly. For example, a column specified as SMALLINT has the usual SMALLINT range of -32768 to 32767, and values outside the range permitted by three digits are displayed in full using more than three digits.
Thus the correct translation for INT would be INT / INTEGER / INT4.
More discrepancies show up with other field types, resulting in the install tool database compare showing changes that are never going to get resolved.
TINYTEXT will be created as VARCHAR and reported as VARCHAR
TEXT and MEDIUMTEXT will be created/reported as LONGTEXT
...
TYPO3: 7.3-dev
DBMS: PostgreSQL 9.4
Related issues
Associated revisions
[TASK] dbal: Move MySQL / DBMS field type translation into DBMS Specifics
The function used by the DBAL provide a very coarse and generic translations
between the ADdb meta types and the MySQL native types. This results in
ambiguities that can't properly be resolved and leads to changes in the
install tool schema migration that can never be resolved.
The default DBMS specifics provided resemble the current output of the
functions and don't result in any changes to the DBMS schema.
Resolves: #67297
Related: #67290
Related: #67288
Releases: master
Change-Id: Id26a897c7f43520edd188e0bd2ddb158507c8049
Reviewed-on: http://review.typo3.org/39954
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
[FEATURE] dbal: DBMS specific conversion between Meta/MySQL field types
This patch changes the implementation of the methods that convert
between ADOdb meta field types and MySQL native field types to allow
overriding the conversion per data type.
The PostgresSpecifics provide better matching of BLOB, SERIAL, DOUBLE
and INTEGER types.
Resolves: #67290
Releases: master
Change-Id: Ieda2a2a26d411b031c2db96821d85e21b2ebb037
Reviewed-on: http://review.typo3.org/40138
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
[FOLLOWUP] Document "DBMS specific conversion between Meta/MySQL field types"
Document the changes in mapping field types and the impact for sites
running PostgreSQL.
Resolves: #67626
Related: #67290
Releases: master
Change-Id: Ie7333e42699c50adc513d490ff25774d70087037
Reviewed-on: http://review.typo3.org/40468
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
History
#1 Updated by Gerrit Code Review about 1 month ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40138
#2 Updated by Gerrit Code Review about 1 month ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40138
#3 Updated by Gerrit Code Review about 1 month ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40138
#4 Updated by Gerrit Code Review about 1 month ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40138
#5 Updated by Gerrit Code Review about 1 month ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40138
#6 Updated by Morton Jonuschat about 1 month ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 873c2e60c4b8e0d27f26d53a91f6f0129f323593.