backy2 icon indicating copy to clipboard operation
backy2 copied to clipboard

Fix MySQL support

Open mennozon opened this issue 6 years ago • 7 comments

As per issue #25 these changes allow the use of MySQL as backend.

mennozon avatar Feb 26 '19 14:02 mennozon

Looks nice. However postgres' varchar limit is 10485760. Not that this would be required. But 128 chars seems a bit restrictive. Are there any limits in mysql that would prevent - say - 2048 or even 4096 characters?

wamdam avatar Mar 26 '19 13:03 wamdam

Maximum seems to be 65535 for MySQL >5.0.3.

I have to admit I didn't know how large this had to be and 128 seemed to work, I figured just specifying something really large might waste space somewhere so I guess 2048 or 4096 shouldn't be a problem.

mennozon avatar Mar 26 '19 15:03 mennozon

It seems there's some other limit I'm running into, I'm getting an error [1] on initdb when using 1024, 2048 or 4096.

I've updated the values to 512 and initdb works, I've created 2 backups and restored them, all seems fine. My other cluster is still using 128 since march without any (known) issues, the new cluster will be using 512 like in this pull request, unless I run into issues with this.

[1] sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1071, 'Specified key was too long; max key length is 3072 bytes') [SQL: '\nCREATE TABLE tags (\n\tversion_uid VARCHAR(36) NOT NULL, \n\tname VARCHAR(4096) NOT NULL, \n\tPRIMARY KEY (version_uid, name), \n\tFOREIGN KEY(version_uid) REFERENCES versions (uid)\n)\n\n'] (Background on this error at: http://sqlalche.me/e/e3q8) INFO: Backy failed.

mennozon avatar Aug 28 '19 09:08 mennozon

[s]iirc, mysql varchar limit is 255 with utf8. 767 bytes indexing[/s] never mind, i was wrong. 65535 bytes. so depending on character encoding different character lengths.

flames avatar Apr 07 '20 10:04 flames

I would love to see this change merged -- is there anything I can do to move it along?

andrewbogott avatar Aug 09 '20 20:08 andrewbogott

Also running with this file hand-modified in a few places. Would be good to get it merged

anomaly256 avatar Feb 16 '21 05:02 anomaly256

Pushed a fix. Could you try again with the master branch?

wamdam avatar Jun 01 '21 06:06 wamdam