problem with loading sql dump into database (version 0.3.0)

15 replies [Last post]
Posts: 147

Hi All,

Yersterday I downloaded the latsest version of netgore and when i wanted to load the sqldump file into the database i got an error. After that i removed this part:
/*
@SUMMARY: Gets all of the the foreign keys for the given primary key. That is, all of the columns and
the tables/schemas they are on that reference the given column.
@PARAMS:
tableSchema: The name of the table's schema.
tableName: The name of the table.
columnname: The name of the column.
@RETURNS: The TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME pairs for all columns that reference the given
column, or empty if nothing references it or it is not a primary key.
*/

after removing this part, it showed no more errors. I am not exactly sure why this piece of text shows this error, but i guess it is just a minor adaption to make it work properly.

Greetz,
AliceD

Posts: 1691

Strange that a comment caused it to fail. What if you just remove the @'s from the text - does it still fail? I'd hate to have to remove the comments completely just to improve compatibility with older versions of MySQL.

Also, what version of MySQL are you using?

Thanks for reporting this.

Posts: 1691

After some research, looks like there are some known issues with comments in stored procedures. It also looks like this is why my old comments in the store procedures were stripped. I'll just remove the comment block for now, and if I ever feel the need to add comments again in the future, find some other way to do it (like documenting it on the site).

Posts: 147

Yeah i also thouth that it could be @'s in the comment block, but that didn''t solve the problem either. Just to let you know i use the latest version of mysql (version 5.50 i believe that is).

Furthermore after trying to play the demo game i got a bunch of errors the moment i wanted to log in. I wil first look if i have done something wrong and if i can find things out myself. if not I will come back to you.

Posts: 180

It worked fine for me. What mysql type are you using?

Mysql, PostGreSQL, SQLite, etc?

Posts: 11

Also as a side note the mysql community build is not supported by the installation verificator, and i believe the problem is that the version string is x.x.x-community. Which is invalid according to the current regex-es used for version verification Smile
And yes, mysql does have problems when you put comments in store procedures, so its best to avoid them or put them above/below the procedure declaration.

Posts: 1691

AliceD wrote:
Furthermore after trying to play the demo game i got a bunch of errors the moment i wanted to log in. I wil first look if i have done something wrong and if i can find things out myself. if not I will come back to you.

Huh, that ain't good. Mind pasting them? I wanted to do a quick little stability release today anyways.

hammer wrote:
Also as a side note the mysql community build is not supported by the installation verificator, and i believe the problem is that the version string is x.x.x-community.

Actually, the community version is the only one supported (since its the one I am expecting most everyone to use, and the only one I can get my hands on). The problem with the version checking regex is that it was just written wrong. Tongue

hammer wrote:
And yes, mysql does have problems when you put comments in store procedures, so its best to avoid them or put them above/below the procedure declaration.

Pff, lame. Then again, I'm not surprised. My experiences with stored procedures in MySQL have been quite poor.

Posts: 147

Hi Spodi,

I will report the error in another bug topic as it is not related to this one.

Posts: 11

@Spodi: i didnt rly read the reg ex when i tried out the validator just returned true on the version check test Smile

Posts: 263

Mmm, our webhost complained about the functions in the sql dump, he couldn't get them to work with his version SQL (Latest stable of whatever version he is using)

Posts: 1691

Darkfrost wrote:
Mmm, our webhost complained about the functions in the sql dump, he couldn't get them to work with his version SQL (Latest stable of whatever version he is using)

I'm guessing its due to the same issue in the original post. I just updated MySQL myself to the latest version and did a complete drop/import of the database dump from the latest revision and it worked flawlessly, so hopefully the next release will have this sorted out.

Posts: 263

Awesome, I'll mail him the queries again and see if they'll run now ^^

Posts: 1691

For everyone who had problems with the last release, please try the new release and let me know if there are any more issues. I like it to be as easy and error-free as possible when it comes to the initial installation, since I know how easy it is for people to give up and never come back just because they couldn't set something up after a minute or two. Wink

Posts: 263

ERROR 1064 (42000): 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 'TIMESTAMP;
ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'NULL'
ERROR 1231 (42000): Variable 'character_set_client' can't be set to the value of 'NULL'
Query OK, 0 rows affected (0.00 sec)

ERROR 1231 (42000): Variable 'collation_connection' can't be set to the value of 'NULL'

Server versie: 5.1.48-0.dotdeb.0
5.1 but not community

When running: http://pastebin.com/BadnPh8F

Posts: 11

For some reason the variables that are used are put before being initiated Smile

/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `ft_banning_isbanned` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection  = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;

i believe should be

/*!50003 SET character_set_client  = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection  = utf8_general_ci */ ;
/*!50003 SET sql_mode              = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
 
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
 
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
 
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `ft_banning_isbanned` */;

Should be ok that way.


EDIT: Okay i did actual tests with different versions of mysql with the dump of 3.0 and 3.1 (the db.sql file, not the installation validator) both work on pretty much every mysql version i had around - 5.1.0 and up to latest from www.mysql.com.
So its not the problem in the dumps. More likely either the mysql server you're using is configured in a bad way or you are (talking in general to ppl with problems) doing something wrong.
99% of the people use phpmyadmin to administrate their databases, so a common problem is that you are actually importing the db via the sql tab in phpmyadmin and didnt set the proper separators.


The CORRECT way (i.e. the most unlikely way to have trouble with) to import a database structure and content is to use the import button in phpmyadmin or the mysql binary if you have access to it.


I believe advanced users dont have this problems as they tend to figure out stuff pretty fast, so this is more for the casual developers/gamers/testers Smile

Posts: 1691

The InstallationValidator also imports it for you if you are running locally. You probably shouldn't be trying to run a remote database without being able to get it to work locally first anyways. Wink