MantisBT

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005495ATutorInstallationpublic2014-07-21 09:192016-01-01 09:59
Reportergreg 
Assigned Togreg 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version2.2Fixed in Version2.2 
Summary0005495: real_escape_string() fails on install (mysql 5.1.66)
DescriptionThere have been a couple report of the following error
Fatal error: Call to a member function real_escape_string() on a non-object in /home/u241584689/public_html/include/lib/mysql_connect.inc.php on line 141

Test the install on freehostingnodes.net
http://www.atutor.ca/view/3/24727/1.html [^]
TagsNo tags attached.
Affects versionSVN
SVN Revision#
Attached Filespng file icon wampATutorInstallation.png [^] (19,669 bytes) 2014-10-03 18:27

- Relationships
related to 0005510closedgreg Installation fails with a fatal error if the database to be created already exists 

-  Notes
(0006846)
greg (administrator)
2014-07-22 12:40

Also see:
http://www.atutor.ca/view/7/24729/1.html [^]
(0006847)
greg (administrator)
2014-07-24 20:52

This issue is the result of the following query failing in the create_and_switch_db() function in include/install/install.inc.php.

$sql = "SHOW CREATE DATABASE `%s`";
$row = queryDB($sql, array($db_name));

It may be due to the use of back quotes, which is required for this query that is used to test the DB character set for UTF-8 collation.

This does not happen on all systems. In this case mysql -v = 5.1.66, tested on freehostingnoads.net.

For a temporary workaround, the else block that the query appears in can be safely removed/commented if the DB is known to be UTF-8, then install will finish successfully.

Continuing to look for a solution...
(0006848)
greg (administrator)
2014-07-25 13:48

The backtick issue does seem to be the problem. Reviewing the fixes in mysql 5.1.67, (Bug #66550, Bug #14548159, Bug #29422, Bug #11746883)

http://dev.mysql.com/doc/relnotes/mysql/5.1/en/news-5-1-67.html [^]
(0006849)
greg (administrator)
2014-07-25 14:33

Possible workaround:

mysql_set_charset('utf8',$connection);

http://stackoverflow.com/questions/7366711/mysql-collation/7449915#7449915 [^]
(0006850)
greg (administrator)
2014-07-26 12:11

Create database privileges are required to run SHOW CREATE DATABASE
(0006852)
greg (administrator)
2014-08-06 17:58

There does not appear to be a satisfactory solution to this issue that does not involve some significant recoding. This will have to wait until after ATutor 2.2 is released
(0006998)
greg (administrator)
2014-10-03 14:49

notes: alex
just reinstalled and could not reproduce
but then I decided to change port to 3310 insteead of 3306 in mamp
and got white screen on my 2.2 step where people have errors
11:53
on step 2 you specify mysql port but even when I put 3310 there explicitely
still blank
although do not want to stir us into wrong direction
if the users are tecksavvy I would STRONGLY recommend to double check that if there is atutor database already, drop it and then redo installation
whenever there are issues with installation and there is a partial result in mysql, installation would always go sideways for me (at least before)
I also would suggest droping a database if one already exists for installation scripts
(0006999)
greg (administrator)
2014-10-04 10:30

I was able to reproduce the problem by creating the database before installing. We're back to the original issue in the second comment above:

$sql = "SHOW CREATE DATABASE `%s`";
$row = queryDB($sql, array($db_name));

mysql_connect.inc.php is not able to run the query. The query runs fine if manually run in mysql. Sounds like a separate function may be required for this particular query.

Any ideas?
(0007000)
greg (administrator)
2014-10-04 10:54

We do need to accomodate an existing database, so can't delete it on installation. Some hosts do not provide the create database privilege, and users must manually create the database through thier control panel.
(0007001)
greg (administrator)
2014-10-04 13:58

created a bundle that hopefully resolves this issue
http://atutor.ca/atutor/files/ATutor-2.2-test.tar.gz [^]
(0007002)
greg (administrator)
2014-10-09 18:23

Added queryDButf8() to mysql_connect.inc.php to handle the installer's check for the existance of a database before creating one, include/install/install.inc.php

Also fixed up step 3 and 6 in the install, to fix the mismtached num of parameters sql error.
(0007179)
greg (administrator)
2016-01-01 09:59

closed for 2.2.1

- Related Changesets
ATutor: master 81f968fc
Timestamp: 2014-10-04 12:48:09
Author: atutor
Details ] Diff ]
5495 created queryDButf8() function to handle the installer's utf8 checking, and fixed a couple mysql query error in step 3 and 6 of the mysql install
mod - include/install/install.inc.php Diff ] File ]
mod - include/lib/mysql_connect.inc.php Diff ] File ]
mod - install/include/step3.php Diff ] File ]
mod - install/include/step6.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2014-07-21 09:19 greg New Issue
2014-07-21 09:19 greg Status new => assigned
2014-07-21 09:19 greg Assigned To => greg
2014-07-22 12:40 greg Note Added: 0006846
2014-07-24 20:52 greg Note Added: 0006847
2014-07-25 13:48 greg Note Added: 0006848
2014-07-25 14:33 greg Note Added: 0006849
2014-07-26 12:11 greg Note Added: 0006850
2014-08-06 17:58 greg Note Added: 0006852
2014-08-06 17:58 greg Status assigned => acknowledged
2014-08-08 18:44 greg Summary real_escape_string() fails on install => real_escape_string() fails on install (mysql 5.1.66)
2014-08-21 19:52 greg Relationship added related to 0005510
2014-10-03 14:49 greg Note Added: 0006998
2014-10-03 18:27 greg File Added: wampATutorInstallation.png
2014-10-04 10:30 greg Note Added: 0006999
2014-10-04 10:54 greg Note Added: 0007000
2014-10-04 13:58 greg Note Added: 0007001
2014-10-04 13:58 greg Changeset attached => ATutor master 81f968fc
2014-10-09 18:23 greg SVN Revision# => master 81f968fc
2014-10-09 18:23 greg Note Added: 0007002
2014-10-09 18:23 greg Status acknowledged => resolved
2014-10-09 18:23 greg Fixed in Version => 2.2
2014-10-09 18:23 greg Resolution open => fixed
2015-09-18 19:43 anonymous SVN Revision# master 81f968fc =>
2016-01-01 09:59 greg Note Added: 0007179
2016-01-01 09:59 greg Status resolved => closed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker