View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
04415Bug reportsImport/Exportpublic2010-07-17 17:25
ReporterMatijs Assigned Toc_schmitz  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version1.90b 
Fixed in Version1.90RC3 
Summary04415: Import of survey times out
Description

When importing a CSV survey the page would time ut - while the database got terribly busy.

Steps To Reproduce

Import any survey.

Additional Information

The function GetNewSurveyID expected to get a NULL back instead of FALSE when GetOne() finds no data.

Diff file included.

TagsNo tags attached.
Attached Files
importsurvey.php.diff (754 bytes)   
Index: importsurvey.php
===================================================================
--- importsurvey.php	(revision 8829)
+++ importsurvey.php	(working copy)
@@ -1680,7 +1680,7 @@
 {
     global $connect, $dbprefix;
     $isresult = $connect->GetOne("SELECT sid FROM {$dbprefix}surveys WHERE sid=$oldsid");
-    if (!is_null($isresult))
+    if (false !== $isresult)
     {
         // Get new random ids until one is found that is not used
         do
@@ -1688,7 +1688,7 @@
             $newsid = getRandomID();
             $isresult = $connect->GetOne("SELECT sid FROM {$dbprefix}surveys WHERE sid=$newsid");
         }
-        while (!is_null($isresult));
+        while (false !== $isresult);
         return $newsid;
     }
     else
importsurvey.php.diff (754 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)1.90
I will donate to the project if issue is resolved
Browser
Database type & versionMySQL 5.1
Server OS (if known)Windows
Webserver software & version (if known)IIS
PHP Version5.2 + 5.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2010-06-16 22:09

administrator   ~12230

Last edited: 2010-06-16 22:10

I am sorry but the patch is bogus.
According to documentation:

http://phplens.com/lens/adodb/docs-adodb.htm#getone

it is supposed to return Null if the record is not found.

Which DB driver are you using?

mdekker

mdekker

2010-06-17 09:17

reporter   ~12244

Last edited: 2010-06-17 09:21

Probably mysqli which returns false... adodb for mysqli seems to be a little buggy.

So mysql does false on error, null on empty while mysqli does only false.

Matijs

Matijs

2010-06-17 12:51

reporter   ~12247

Ah sorry. I didn't know adodb was from a separate project. I'll bump the bug to them and create a new temprary patch that fixes the mysqli driver.

(I will do this somewhen next week.)

c_schmitz

c_schmitz

2010-06-29 20:37

administrator   ~12311

Matijs, how about it?

Mazi

Mazi

2010-07-13 02:18

updater   ~12396

"I'll bump the bug to them" -> maybe you can add the link to the ticket here so we can follow progress.

Thanks!

c_schmitz

c_schmitz

2010-07-17 17:25

administrator   ~12441

http://phplens.com/lens/lensforum/msgs.php?id=18407

I patched our packaged class accodingly.

Issue History

Date Modified Username Field Change
2010-06-11 15:53 Matijs New Issue
2010-06-11 15:53 Matijs Status new => assigned
2010-06-11 15:53 Matijs Assigned To => user372
2010-06-11 15:53 Matijs File Added: importsurvey.php.diff
2010-06-16 22:08 c_schmitz Assigned To user372 => c_schmitz
2010-06-16 22:09 c_schmitz Note Added: 12230
2010-06-16 22:10 c_schmitz Note Edited: 12230
2010-06-16 22:10 c_schmitz Status assigned => feedback
2010-06-17 09:17 mdekker Note Added: 12244
2010-06-17 09:21 mdekker Note Edited: 12244
2010-06-17 12:51 Matijs Note Added: 12247
2010-06-17 12:51 Matijs Status feedback => assigned
2010-06-29 20:37 c_schmitz Note Added: 12311
2010-06-29 20:37 c_schmitz Status assigned => feedback
2010-06-29 20:39 c_schmitz Priority urgent => normal
2010-07-13 02:18 Mazi Note Added: 12396
2010-07-17 17:25 c_schmitz Note Added: 12441
2010-07-17 17:25 c_schmitz Status feedback => closed
2010-07-17 17:25 c_schmitz Resolution open => fixed
2010-07-17 17:25 c_schmitz Fixed in Version => 1.90RC3