Skip to content
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

mysqli: TEXT/BLOB default value differences MariaDB>10.2.1 vs MySQL8 #704

Closed
peterdd opened this issue Mar 14, 2021 · 2 comments
Closed
Labels
mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1) wontfix

Comments

@peterdd
Copy link
Contributor

peterdd commented Mar 14, 2021

Table fields with datatype 'TEXT' can have a default value set since MariaDB 10.2.1

MySQL8 does not allow that.

I stumbled over that because 5.21.0 looks if a $blobAllowsDefaultValue is true and MariaDB now gets no default value for an 'X' datatype table field of a xmlschema03 file.

Dunno what to do with it, just wanted let you know.

Now I think of replacing some fields of my schema that was 'X' by 'C' varchars for crossdb compatibility but unsure about pro and contra of that.

Maybe inheritance of datadict-mysql with a datadict-mariadb class?

@dregad dregad added the mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1) label Mar 14, 2021
@dregad
Copy link
Member

dregad commented Mar 14, 2021

Maybe inheritance of datadict-mysql with a datadict-mariadb class?

This approach is fine as long as MariaDB is a superset of MySQL; the potential problem could be if there is a feature difference going the other way around, i.e. something in MySQL that does not exist in MariaDB, and would then be inherited but should not.

Alternatives could be: a new mariadb driver starting as a copy of current mysqli, but that's a lot of code duplication meaning increased maintenance and risk of forgetting to apply a common change to both drivers. Not sure I like that either.

Or probably best but more complex to implement, we have some common base class, and derive individual drivers from it.

@mnewnham mnewnham changed the title TEXT/BLOB default value differences MariaDB>10.2.1 vs MySQL8 mysqli: TEXT/BLOB default value differences MariaDB>10.2.1 vs MySQL8 Mar 25, 2021
peterdd referenced this issue in flyspray/flyspray Mar 28, 2021
seems ADOdb 5.21.0 xmlschema03 query tag cannot yet handle multiline queries
@mnewnham
Copy link
Contributor

From MySQL 8.0.13, you can add a default value to MySQL TEXT columns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1) wontfix
Projects
None yet
Development

No branches or pull requests

3 participants