Git Product home page Git Product logo

Comments (9)

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

The other workaround is to reduce the length of the filename field to 330 characters, which should still be sufficient for most cases. I have made that change in 3e4b826

from getid3.

cheesegrits avatar cheesegrits commented on August 23, 2024

Thanks.

I went for the character set solution as a couple of my users actually have crazy long path names. If it turns into a problem, I'll PR something to check for the length of $filename in analyze() and "miss" if it's longer than 330.

If I get really enthusiastic, I'll PR a change to mysqli or PDO, so avoid those deprecated warnings. :)

Anyway - thanks for the fix.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

With a latin1 filename field there's no reason the length couldn't be increased from 500 up to 990 if you like.

I have quickly thrown together a clone of getid3.extension.cache.mysql.php to getid3.extension.cache.mysqli.php and changed the MySQL calls to MySQLi. I haven't really tested it however, so if you want to see how well it works for you I would appreciate that:
adfd32a

from getid3.

cheesegrits avatar cheesegrits commented on August 23, 2024

I submitted a PR with fixes for the new code.

I suspect you may need to fix that CHARSET usage in the original code as well.

from getid3.

cheesegrits avatar cheesegrits commented on August 23, 2024

Just to be clear about that CHARSET fix, I don't know if it's a MySQL version thing, but all the versions I use, it's CHARACTER SET not CHARSET ...

http://dev.mysql.com/doc/refman/5.7/en/charset-database.html

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

I got CHARSET from show create table and in the two installations I have at hand (5.6 and 5.1) they both show CHARSET there, but do accept CHARACTER SET. I have copied it to the mysql version.

from getid3.

Aybee avatar Aybee commented on August 23, 2024

This line did not work for me
https://github.com/JamesHeinrich/getID3/blob/v1.9.17/getid3/extension.cache.mysqli.php#L211
(edit: changed the link from master to v1.9.17)

Table gets not created. Error Message
Specified key was too long; max key length is 767 bytes

It's a MaraiDB with a DB of collation latin1_swedish_ci. I have to set this value to 767.

If I set the DB to collation utf8_general_ci then the error also occurs and its not possible to create the table even with 767.

I think its necessary to improve the table create process so it will fit to more situations.

from getid3.

StudioMaX avatar StudioMaX commented on August 23, 2024

As a workaround we can create a new column like hash VARCHAR(32) NOT NULL DEFAULT '', use it in primary key instead of previous filename and search for md5($filename) instead of $filename. But this will be a BC-break for all previously created tables.

from getid3.

JamesHeinrich avatar JamesHeinrich commented on August 23, 2024

I have made a tentative change in 5e91157 to just the MySQLi version. If it seems like a reasonable change then I can migrate that to the other versions of the cache extension as well.

from getid3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.