PDA

View Full Version : Invalid SQL schema. Get help from Developers


jasonbash
02-07-2008, 04:04 AM
Hi Folks,

PHP version: 5.2.5
MySQL version: 5.0.45
osTicket version: RC3

I am trying to install osTicket but getting the following error message on installation /setup/index.php

Invalid SQL schema. Get help from Developers <<< at the top of the page

Database
MySQL is the only database supported at the moment.
You have an error in your SQL syntax <<< Near the bottom

Can anyone suggest a solution?

Thanks in advance!

peter
02-07-2008, 05:25 PM
JasonB,

Hard to tell which query is causing the error.

Edit setup/index.php and make the following changes;

Change:
$errors['mysql']='You have an error in your SQL syntax';
to
$errors['mysql']='You have an error in your SQL syntax '.$sql .'['.db_error().']';

Give it another try and let us know the error message displayed.

jasonbash
02-07-2008, 10:02 PM
Thanks Peter. This is the db_error() output that I got:

You have an error in your SQL syntax CREATE TABLE ost_config .... [BLOB/TEXT column 'api_whitelist' can't have a default value]

peter
02-08-2008, 12:36 AM
Edit setup/osticket.sql change api_whitelist tinytext NOT NULL default '', to api_whitelist tinytext NOT NULL,

jasonbash
02-08-2008, 01:52 AM
Yeah, I tried that earlier (api_whitelist tinytext NOT NULL,), then I got another error:

You have an error in your SQL syntax INSERT INTO ost_config SET isonline=1, updated=NOW()[Field 'api_whitelist' doesn't have a default value]

So, now I changed that to:
INSERT INTO %TABLE_PREFIX%config SET isonline=1, updated=NOW(), api_whitelist='';

And boom, that seemed to work and got the sweet confirmation: "Congratulations osTicket basic installation completed!"

So,
1. Is the hack above recommended?
2. Do I need to hack any other file as far as 'api_whitelist' field is concerned?
3. Did I get this error because of the MySQL version, or that I am using Windows - not all behavior can be expected to run as they should?

I have fiddled with osTicket a bit, and think it's a fantastic application with great attention to detail and quality. Thanks for this excellent application!

peter
02-08-2008, 02:02 AM
The issue is caused by MySQL when in strict mode which is common with windows installations. Next release will include the hack.

Enjoy and please remember to provide us with feedback.