-
-
Notifications
You must be signed in to change notification settings - Fork 112
Support mysql8 #3253
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
Support mysql8 #3253
Conversation
Interessant.. hier gibts test errors.. in #3254 mit mysql 8 ist alles grün |
@gharlan @bloep ich denke es wäre super wenn wie die paar tests für mysql8 noch grün bekommen für 5.9... vllt komm ich morgen dazu.. falls jemand von euch dazu kommt, gerne hier weitermachen Ich vermute dass redaxo auf mysql8 aktuell nicht wirklich funktionieren kann, so wie die testfehler ausschauen |
https://dev.mysql.com/doc/refman/8.0/en/information-schema.html |
…o staabm-patch-2
hmm
mysql8 scheint hier die länge der spalten nicht drinnen zu haben.. lt docs sollten die dort aber drinne sein.. |
@@ -104,7 +104,7 @@ public function setType($type) | |||
} | |||
|
|||
/** | |||
* @return string | |||
* @return string The column type, including its size, e.g. int(10) or varchar(255) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
das mit dem "inlcuding size" scheint für mysql8 noch nicht zu passen.. aus BC gründen müsste man es aber versionsübergreifend hier gleich haben... keine ahnung woran es da hängt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meine erste Vermutung war, dass es vllt nur bei der Max Size (also 11 für signed und 10 für unsigned) so ist.
Aber ist auch bei kleineren ints so, habe dafür noch einen Test ergänzt.
Konnte zu der Problematik leider auch noch nichts weiter finden.
Die Doku zu mysql 8 behauptet auch, es würde "int(11)" zurückkommen:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ich schau mir das nachher mal an und such mal ein bissl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ggf. hängt es hiermit zusammen?
https://dba.stackexchange.com/a/184546
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich denke, ich habe endlich den Grund gefunden:
https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
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(4) 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 is up to the application.)
und
As of MySQL 8.0.17, the ZEROFILL attribute is deprecated for numeric data types, as is the display width attribute for integer data types. Support for ZEROFILL and display widths for integer data types will be removed in a future MySQL version. Consider using an alternative means of producing the effect of these attributes.
Ich überlege mir was, wie wir damit umgehen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vorschlag ist nun drin.
So würde ich zumindest nun für die 5.9 verfahren.
Für zukünftige Versionen könnte man dann eher schauen, mehr zu int
und int unsigned
zu kommen. Also statt wie jetzt ein Workaround für MySQL 8, dann ein Workaround eher für die anderen Versionen.
Noch als idee eingeworfen: vllt kann man mal bei phpmyadmin/adminer o.ä. Schauen wie das dort gehandhabt wird |
# Conflicts: # redaxo/src/core/tests/sql/sql_table_test.php
This reverts commit b894de4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schuer hat den PR über Docker mit MySQL 8.0.0 und der aktuellen 8.0.19 kurz angetestet und funktioniert soweit!
@@ -85,9 +85,19 @@ private function __construct($name, int $db = 1) | |||
} | |||
|
|||
foreach ($columns as $column) { | |||
$type = $column['type']; | |||
|
|||
// Since MySQL 8.0.17 the display width for integer columns is deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gibts dazu nen link von mysql selbst?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Siehe #3253 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Danke fürs abschließen
Inspired by doctrine/dbal#3372
Closes #2351