Issues with MySQL 5 in Mods

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Yautja_cetanu
Registered User
Posts: 72
Joined: Wed Nov 24, 2004 3:23 pm

Issues with MySQL 5 in Mods

Post by Yautja_cetanu »

I have a problem with multiple mods (So I don't think its an issue with the mods but my phpbb installation and server.

An example is when one mod wants me to do this:
CREATE TABLE m2f_config ( config_name varchar(64) default '', config_value text default '' )


I get this message:
Error: BLOB/TEST clumn 'config_value' can't have a default value


also had problems with easymod where I had to manually edit out the default.

I'm using MySQL 5.0.26
IIS 5
Win2k
php 5.1.6
phpbb 2.0.26

Any ideas? Is this the wrong place to ask for support on this subject?
Last edited by Yautja_cetanu on Mon Feb 12, 2007 11:09 pm, edited 1 time in total.
geocator
Registered User
Posts: 16242
Joined: Fri Jan 09, 2004 11:56 pm
Location: On dry land
Contact:

Post by geocator »

The example above is due to the MOD, they did not take mySQL 5 restrictions in to effect. You will find this is the case with core files and most MODs.
Yautja_cetanu
Registered User
Posts: 72
Joined: Wed Nov 24, 2004 3:23 pm

Post by Yautja_cetanu »

Had a similarish problem with a different mods
SQL Error : 1366 Incorrect integer value: '' for column 'music_auto_start' at row 1

INSERT INTO phpbb_mps (mps_id, page_title, about, meet, self_title, sex, mps_quiz_results, song, video, music_code, music_auto_start, myspace_url) VALUES ('3', 'The Cool Profile For Jamie', 'I\'m really cool!', 'Definitely Not Hiten', 'Jamie is amazing', '2', '', '', '', '', '', 'Yautja_Cetanu')

Line : 362
File : mps.php


Just out of interest. How would MySQL 5 deal with this? It seems to dislike inputting null values and "". So what do you do if you want a null?

Would it be
INSERT INTO phpbb_mps (mps_id, page_title, about, meet, self_title, sex, mps_quiz_results, song, video, music_code, music_auto_start, myspace_url) VALUES ('3', 'The Cool Profile For Jamie', 'I\'m really cool!', 'Definitely Not Hiten', 'Jamie is amazing', '2', '0', '0', '0', '0', '0', 'Yautja_Cetanu')



EDIT: Stupid Bots...

Or would it be:
INSERT INTO phpbb_mps (mps_id, page_title, about, meet, self_title, sex, mps_quiz_results, song, video, music_code, music_auto_start, myspace_url) VALUES ('3', 'The Cool Profile For Jamie', 'I\'m really cool!', 'Definitely Not Hiten', 'Jamie is amazing', '2', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'Yautja_Cetanu')
Last edited by Yautja_cetanu on Mon Feb 12, 2007 11:13 pm, edited 1 time in total.
geocator
Registered User
Posts: 16242
Joined: Fri Jan 09, 2004 11:56 pm
Location: On dry land
Contact:

Post by geocator »

It does not dislike nulls, but unlike in mysql 4, the table has to be defined to except null values.
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Post by espicom »

And this:

Code: Select all

'NULL'
is not the same as:

Code: Select all

NULL
The first is a string containing the word "NULL".

The "bad integer value" is because the empty string isn't an integer... if the MOD used '0' instead, it would have been interpreted as a valid number, even though it was a string.

Rule of thumb: if a MOD says "MySQL only", you probably cannot use it with MySQL 5, because one of the "features" of 5.x is that it is as rigid on checking SQL syntax as other SQL servers, which is why the MODs couldn't be used with the others in the first place.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer
Yautja_cetanu
Registered User
Posts: 72
Joined: Wed Nov 24, 2004 3:23 pm

Post by Yautja_cetanu »

O.k a couple more questions then.

Are '' and NULL the same thing? Or do you HAVE to do NULL now? Doesn't that complicate doing forms? Where as before you could say something like '$form' and whatever was typed into the form you'd automatically put into the database. Now you'd need some kind of IF statement?

Or do we just have to make Tables that accept nulls. How do you do this?
Organic Angel Alexiel
Registered User
Posts: 262
Joined: Tue Oct 24, 2006 10:30 pm
Location: Sunny Cal, USA
Contact:

Post by Organic Angel Alexiel »

NULL means it has no value. zero is still a value, same thing with a string with no next. It has a value still. NULL means it doesn't.

Also, any error of php_table_column not being able to have a default value, copy the insert, and remove the default value, and re-run the query. I use MySQL 5.0 and I have come accross this problem in about 5 of my mods (out of 60). Annoying, but not too much a problem. Works fine.
Need help with apache? Visit the Apache Lounge
I would heartily recommend reading through the Knowledge Base. I recently have and it has solved a number of questions I had.
EasyMod is great for a vanilla phpBB. Visit my website and see why I do everything by hand. :P
Locked

Return to “2.0.x Support Forum”