Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- How to add Cover Image? HOT 1
- PHP Notice: Undefined index: data
- module.tag.id3v2 crashes PHP 8.2.12 if opcache enabled HOT 10
- fread(): Argument #2 ($length) must be greater than 0 HOT 1
- libxml_disable_entity_loader is deprecated HOT 3
- Garbage extracted from a RIFF tag in an AIFF file HOT 2
- Not work WRITE function in Windows 10/php7.4
- Write Synchronised lyric (SYLT)
- Unable to determine .gpx file HOT 5
- Deprecated: Implicit conversion from float ... to int loses precision HOT 7
- Mpeg duration error due to error in GOP parsing HOT 2
- Tag format "id3v2.3" is not allowed on "" files,
- Warning on PrintHexBytes function when $string is not a string. HOT 3
- Integrating into a Joomla 5 site
- Caught exception: Uninitialized string offset 0 HOT 8
- Reflected XSS Vulnerability in demo.browse.php (all version?) HOT 3
- Support for MXF HOT 1
- $getID3->setOption(array('option_tag_apetag' => false)); failing to switch off ape processing HOT 4
- Fix: ogg file formats wrong duration HOT 1
- Fatal error with curly braces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getid3.