[4342]wrong $no_engine_support ?

Started by seeker365, May 27, 2010, 08:55:38 PM

Previous topic - Next topic

seeker365

in these files:
Sources# grep -lr no_engine_support .
./DbExtra-mysql.php
./DbPackages-mysql.php
./DbSearch-mysql.php



$no_engine_support = version_compare('4', $smcFunc['db_get_version']) > 0;


should be:


$no_engine_support = version_compare('4', $smcFunc['db_get_version']() ) > 0;



-.kim.-

hi, this is my first post here.

I think I've found a bug:

in 'Admin' → 'Forum' → 'Search' → 'Search Method' when I try to create a custom index, I get this error:


Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 5
File: [mypath]/Sources/ManageSearch.php
Line: 564


TYPE is deprecated since mysql 4.1. I use mysql 5.5 and with that only ENGINE is supported.

line 564:
$smcFunc['db_create_word_search']($index_properties[$context['index_settings']['bytes_per_word']]['column_definition']);


I don't know SMF very well, so I'm unable to solve the problem. any suggestions?

-.kim.-


-.kim.-

can anyone tell to a noob like me, at least, in what file(s) should I search for 'TYPE'?

-.kim.-

I found it myself:

dbsearch-mysql.php


$smcFunc['db_query']('', '
CREATE TABLE {db_prefix}log_search_words (
id_word {raw:size} unsigned NOT NULL default {string:string_zero},
id_msg int(10) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_word, id_msg)
) {raw:engine_type}=InnoDB',
array(
'string_zero' => '0',
'size' => $size,
// MySQL users below v4 can't use engine.
'engine_type' => $no_engine_support ? 'TYPE' : 'ENGINE',
)





I simply changed it to:


$smcFunc['db_query']('', '
CREATE TABLE {db_prefix}log_search_words (
id_word {raw:size} unsigned NOT NULL default {string:string_zero},
id_msg int(10) unsigned NOT NULL default {string:string_zero},
PRIMARY KEY (id_word, id_msg)
) ENGINE=InnoDB',
array(
'string_zero' => '0',
'size' => $size,
)


maybe it can be useful for some users in the future.

however, I don't think that the bug is located here... maybe it's in $no_engine_support...


-.kim.-

tank you for the very useful help and for your interest about that problem/bug

Norv

You're right, unfortunately I've been available for a quite reduced time.
Thank you for the report, and sorry for the delay.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

vbgamer45

bah I never understood why the software designers would stop supporting "TYPE"  they can just make it an alias instead of making it harder for people developing for that system and updating all the code around it.... It makes no sense to me.


Norv, i saw that note there about Engine only used for Mysql 4 and higher  is there anyone using an older version of mysql still? I had two commits for 1.1.x and 1.0.x to use engine instead of type so it would work with 5.5 and higher.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Norv

In fact SMF 2.0 should probably not be expected to be compatible with less than MySQL 4.1... (if not more, I think the final version will settle this requirement too, as it's not public yet afaik).

SMF 1.1.x should be compatible with MySQL 3.23. :)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

vbgamer45

Time for more conditional checks!! Found a couple other places n 1.1.x using type such as db backups time for fun!
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

-.kim.-

Quote from: Norv on July 04, 2010, 11:59:24 AM
You're right, unfortunately I've been available for a quite reduced time.
Thank you for the report, and sorry for the delay.

so... tanks and sorry for my previous reply, as you may imagine I was a bit frustrated...

Norv

I fully understand. And I really appreciate you registered to let us know of the issue, thank you very much for taking the time for it. :)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Norv

To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github


Advertisement: