View Issue Details

This bug affects 1 person(s).
 14
IDProjectCategoryView StatusLast Update
03756Bug reportsSurvey editingpublic2009-11-09 14:11
Reporteruser5141Assigned Tojcleeland  
PrioritynormalSeveritypartial_block 
Status closedResolutionunable to reproduce 
Product Version1.86 
Summary03756: SQL error messages when trying to update start or expiry date
Description

When I create a new survey and edit the start a/o expiry date afterwards, I get this error message:

Error updating
UPDATE SET STARTDATE='2009-10-09 12:00:00', EXPIRES='2009-10-11 12:00:00' WHERE sid=93523

<strong>FEHLER: Syntaxfehler bei »=« LINE 1: UPDATE SET STARTDATE='2009-10-09 12:00:00', EXPIRES='2009-1... ^

"FEHLER: Syntaxfehler bei" means "ERROR: Syntax error at".

TagsNo tags attached.
Attached Files
database.diff (429 bytes)   
1098,1107c1098,1099
<         
< 		$usquery=$connect->GetUpdateSQL($rs, $updatearray);
< 
< 		// Workaround - sometimes you get an invalid SQL query string when using PSQL as your database
< 		$tokens = split(" ", $usquery);
< 		if ($tokens[1] == "") {
< 			$tokens[1] = db_table_name('surveys');
< 			$usquery = implode(" ", $tokens);
< 		}
< 
---
>               
>         $usquery=$connect->GetUpdateSQL($rs, $updatearray); 
database.diff (429 bytes)   
Bug heat14
Complete LimeSurvey version number (& build)7697
I will donate to the project if issue is resolved
BrowserFirefox
Database type & versionPostgreSQL 8.3.8
Server OS (if known)Linux
Webserver software & version (if known)Apache
PHP Version5.2.6

Relationships

related to 03784 closedjcleeland Can't create survey if expiry date is set 

Users monitoring this issue

jcleeland

Activities

user372

2009-10-09 13:47

  ~09755

I can't reproduce the issue on MySQL.
@ rakete: please check PostgreSQL - Thx!

rakete

rakete

2009-10-09 14:23

reporter   ~09756

in order to check i had to update my db...

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/tim/htdocs/limesource/limesurvey/admin/update/upgrade-postgres.php on line 186

haha...
I fix this first and afterwards investigate the error... ;)

rakete

rakete

2009-10-09 14:46

reporter   ~09757

I cannot reproduce this with 1.87beta nor with 1.85+

I have no 1.86 version in my testenviroment right now...

??? strange...

the SQL Expression is totally correct, I can perform it as a query over pgAdmin and I does the changes without a hitch.

Only thing I can think of, is an old table or somehow missing fields in the Table.
Doing a clean reinstall of the latest build should fix the problem.

user5141

2009-10-12 10:31

  ~09782

Hi,

I made a fresh install of the current build today and the error remains.
As the error message says there is a syntax error in the sql query. To be more exact, the name of the table is missing.

user5141

2009-10-12 11:06

  ~09783

"UPDATE SET STARTDATE='2011-12-09 12:00:00', EXPIRES='2014-12-09 12:00:00', ADDITIONAL_LANGUAGES='de ' WHERE sid=18313"

It seems to be a general problem. When I try to add an additional language to the survey it generates the same error.
Another weird thing is that the update statement tries to set a completely wrong date.

user5141

2009-10-20 15:32

  ~09824

Last edited: 2009-10-20 15:33

Hi,

After further investigation of the problem I created a workaround for it. The diff-file is attached to the report.

user372

2009-10-20 21:50

  ~09828

Reminder sent to: jcleeland

Hi Jason, do you think your latest fix (03784) in rev. 7767 also solved that issue?

lemeur

lemeur

2009-10-20 22:01

developer   ~09829

@Jason,

do you think your latest fix (03784) in rev. 7767 also solved that issue?

Mazi

Mazi

2009-10-20 23:37

updater   ~09836

I talked to gju on IRC and he pointed out that it might be a postgres - AdoDB problem. Can you add some more information, gju?

jcleeland

jcleeland

2009-10-21 01:34

reporter   ~09837

Hmmm. I've just tested the bug on my postgres installation and am unable to reproduce it. This could be because of my fix 03784, or it could be some other reason.

Looking at the error message "SYNTAX ERROR", and the apparent SQL querys ("UPDATE SET STARTDATE='2011-12-09 12:00:00', EXPIRES='2014-12-09 12:00:00', ADDITIONAL_LANGUAGES='de ' WHERE sid=18313") I don't know if anyone else noticed, but there is no table name after the UPDATE statement. Shouldn't it say "UPDATE surveys SET..."?

Anyway, the weird date formatting was causing the MySQL bug, so I think it's worth trying this with my fix before we continue.

Jason

user5141

2009-10-21 13:19

  ~09845

Hey,

I did some more research on the problem yesterday and found out that the error I get is caused by the adodb library. It always returns an empty string for the table name wich then leads to the wrong query string.
After some debugging I noticed that the RegEx at line 93 in file adodb.inc.php is modified or wrongly interpreted in the file adodb-lib.inc.php line ~702. That's the place where the sql string gets parsed for the table name.
After I inserted some echo statements to check the content of the RegEx I noticed that it was wrong, here's the code + output: http://pastie.org/private/wwbhj8xjwdyrrl5qkbtrea

I tried defining the constant with an other name right before the sql string gets parsed and it worked perfectly ok... so my resume is that either the constant gets redefined somehwere (wich I also checked but didn't find anything) or there is a problem when adodb-lib gets included into adodb.inc.php.

jcleeland

jcleeland

2009-11-09 14:11

reporter   ~10025

Given that the only person who is able to reproduce this bug is gju, I'm not sure what we should do next. If a bug can't be confirmed on a seperate installation, it can't really be fixed. Both myself and rakete tested the bug on seperate postgresql installations and weren't able to reproduce it. I think we should close the bug.

Issue History

Date Modified Username Field Change
2009-10-09 10:36 user5141 New Issue
2009-10-09 10:36 user5141 Status new => assigned
2009-10-09 10:36 user5141 Assigned To => user372
2009-10-09 10:36 user5141 LimeSurvey build number => 7697
2009-10-09 10:36 user5141 Browser => Firefox
2009-10-09 10:36 user5141 Database & DB-Version => PostgreSQL 8.3.8
2009-10-09 10:36 user5141 Operating System (Server) => Linux
2009-10-09 10:36 user5141 Webserver => Apache
2009-10-09 10:36 user5141 PHP Version => 5.2.6
2009-10-09 13:47 user372 Note Added: 09755
2009-10-09 13:47 user372 Assigned To user372 => rakete
2009-10-09 14:23 rakete Note Added: 09756
2009-10-09 14:46 rakete Note Added: 09757
2009-10-09 14:46 rakete Status assigned => feedback
2009-10-12 10:31 user5141 Note Added: 09782
2009-10-12 11:06 user5141 Note Added: 09783
2009-10-20 14:58 Mazi Relationship added related to 03784
2009-10-20 15:32 user5141 Note Added: 09824
2009-10-20 15:33 user5141 File Added: database.diff
2009-10-20 15:33 user5141 Note Edited: 09824
2009-10-20 21:50 user372 Issue Monitored: jcleeland
2009-10-20 21:50 user372 Note Added: 09828
2009-10-20 22:00 lemeur Status feedback => assigned
2009-10-20 22:00 lemeur Assigned To rakete => jcleeland
2009-10-20 22:01 lemeur Note Added: 09829
2009-10-20 23:37 Mazi Note Added: 09836
2009-10-20 23:37 Mazi Status assigned => feedback
2009-10-21 01:34 jcleeland Note Added: 09837
2009-10-21 13:19 user5141 Note Added: 09845
2009-11-09 14:11 jcleeland Note Added: 10025
2009-11-09 14:11 jcleeland Status feedback => closed
2009-11-09 14:11 jcleeland Resolution open => unable to reproduce
2010-10-25 00:17 c_schmitz Category Survey Design => Survey design
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-04 23:49 guest Bug heat 12 => 14