News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

'ORDER BY null' at line 203

Started by rollntider, August 21, 2012, 01:13:13 AM

Previous topic - Next topic

rollntider

Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Preparing for categories conversion... Successful.
Converting categories... Successful.
Converting boards... Successful.
Fixing categories... Successful.
Converting topics... Successful.
Converting posts...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 'ORDER BY null' at line 203

I am using phpBB 3.0.10 and trying to convert to the latest version on this site downloaded today... I have googled, searched this forum and at a loss

emanuele

Hello rollntider and welcome to sm.org! :)

Just to be sure: what converter are you using?
The one from the download section?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

rollntider

Quote from: emanuele on August 21, 2012, 04:32:26 AM
Hello rollntider and welcome to sm.org [nofollow]! :)

Just to be sure: what converter are you using?
The one from the download section?

yes I am, thank you for the reply

emanuele

Could you try starting again the conversion adding to the url: ?debug=true
That should give some more details on the error...hopefully...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

rollntider

Quote from: emanuele on August 21, 2012, 11:04:46 AM
Could you try starting again the conversion adding to the url: ?debug=true
That should give some more details on the error...hopefully...

it seemed to go through with debug.... I am confused... is that what was needed?


thanks




emanuele

Well...not exactly...in theory with debug you should get more meaningful error messages but it's not the first time I see that weird behaviour...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

rollntider

Quote from: emanuele on August 21, 2012, 12:33:39 PM
Well...not exactly...in theory with debug you should get more meaningful error messages but it's not the first time I see that weird behaviour...

I was not able to log in, maybe because the name I originally set up and the name I imported were the same. I will do a fresh install of SMF and try again. Thanks for your help. If I run into something else I will post back. Thank you again.

rollntider

Quote from: emanuele on August 21, 2012, 12:33:39 PM
Well...not exactly...in theory with debug you should get more meaningful error messages but it's not the first time I see that weird behaviour...

Converting posts...Notice: Undefined index: cache_enable in /home/content/r/o/l/rollntider/html/smfforums/Sources/Subs-Db-mysql.php on line 435You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY null' at line 203

like i said the last one worked but could not log in. started over and now getting this

emanuele

Try this: go to phpmyadmin, your database and then search for the table "smf_log_errors".
Find the last entry and report here the message (in case it is too long you may need to edit the field to be able to copy and paste the entire string).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

rollntider

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0009 sec)

hope i did it right

ThorstenE

Which MySQL version is that server? MySQL seems to have an issue with SMF's database layer (ORDER BY NULL will automatically be added if there's no ORDER defined).

A workaround (for the conversion process) would be to add ORDER to the related section in phpbb3_to_smf.sql
find
Code (find) Select
p.post_text AS body
replace with
Code (replace) Select
p.post_text AS body
ORDER BY p.post_id



rollntider

Quote from: Thorsten Eurich on August 22, 2012, 12:59:41 AM
Which MySQL version is that server? MySQL seems to have an issue with SMF's database layer (ORDER BY NULL will automatically be added if there's no ORDER defined).

A workaround (for the conversion process) would be to add ORDER to the related section in phpbb3_to_smf.sql
find
Code (find) Select
p.post_text AS body
replace with
Code (replace) Select
p.post_text AS body
ORDER BY p.post_id




thanks

Converting posts...

Unsuccessful!
This query:
SELECT
p.post_id AS id_msg, p.topic_id AS id_topic, p.forum [nofollow]_id AS id_board,
p.post_time AS poster_time, p.poster_id AS id_member, p.post [nofollow]_subject AS subject,
IFNULL(m.username, 'Guest') AS poster_name,
IFNULL(m.user_email, 'Unknown') AS poster_email,
IFNULL(p.poster_ip, '0.0.0.0') AS poster_ip,
p.enable_smilies AS smileys_enabled, p.post [nofollow]_edit_time AS modified_time,
CASE p.post [nofollow]_edit_user WHEN 0 THEN 'Guest' ELSE m2.username END AS modified_name,
p.post_text AS body
ORDER BY p.post [nofollow]_id
FROM `blindsideblitz`.phpbb_posts AS p
LEFT JOIN `blindsideblitz`.phpbb_users AS m ON (m.user_id = p.poster_id)
LEFT JOIN `blindsideblitz`.phpbb_users AS m2 ON (m2.user_id = p.post [nofollow]_edit_user)
LIMIT 0, 200;
Caused the 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 'FROM `blindsideblitz`.phpbb_posts AS p
LEFT JOIN `blindsideblitz`.phpbb_users A' at line 11

thats the error now

ThorstenE

sorry, my mistake.. IIRC ORDER BY needs to be at the end of a sql statement:
instead of my above suggestion:
find:
Code (find) Select
LEFT JOIN {$from_prefix}users AS m2 ON (m2.user_id = p.post_edit_user);
replace with:
Code (replace) Select
LEFT JOIN {$from_prefix}users AS m2 ON (m2.user_id = p.post_edit_user)
ORDER BY p.post_id;

rollntider

Quote from: Thorsten Eurich on August 22, 2012, 03:04:58 AM
sorry, my mistake.. IIRC ORDER BY needs to be at the end of a sql statement:
instead of my above suggestion:
find:
Code (find) Select
LEFT JOIN {$from_prefix}users AS m2 ON (m2.user_id = p.post_edit_user);
replace with:
Code (replace) Select
LEFT JOIN {$from_prefix}users AS m2 ON (m2.user_id = p.post_edit_user)
ORDER BY p.post_id;


thanks i will try it in a bit

rollntider

Converting posts...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 'ORDER BY null' at line 203


emanuele

Quote from: rollntider on August 21, 2012, 05:41:17 PM
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0009 sec)

hope i did it right
And before that one?
I would expect an error message with a query.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Chelien Orlenard

The same trouble.

phpBB version 3.0.10
SMF version 2.0.4
Using the latest converter.

Do you still have not solved this problem?

Chelien Orlenard

I solved the problem myself.
I modified the following parts of the source.

Sources/Sub-Db-mysql.php

find:
$db_string = substr($db_string, 0, $pos) . "\t\t\tORDER BY null\n" . substr($db_string, $pos, strlen($db_string));

replace with:
$db_string = substr($db_string, 0, $pos) . "\n" . substr($db_string, $pos, strlen($db_string));

find:
$db_string .= "\n\t\t\tORDER BY null";
replace with:
$db_string .= "";

This fix is only temporary, I undo the conversion is finished.
Thank you.


Advertisement: