Error with db_rows()

Bug #138543 reported by George Petsagourakis
2
Affects Status Importance Assigned to Milestone
Ajato
Status tracked in 0.x
0.x
Fix Released
Critical
Massa

Bug Description

Trying to install Ajato again,... Xavante, sqlite3, Windows.
On Step 2 with values : dbtype 'sqlite3', dbname './sites/default/ajato.db'
produces the following error:

modules/system/system.module.lua:149: attempt to call a nil value
stack traceback:
  c:\Kepler\1.1\lua/coxpcall.lua:24: in function
  (tail call): ?
  (tail call): ?
  c:\Kepler\1.1\lua/cgilua.lua:438: in function '_xpcall'
  c:\Kepler\1.1\lua/cgilua.lua:544: in function 'main'
  [string "..."]:57: in function <[string "..."]:57>

This is a call to db_rows() and is in function 'system_get_files_database()' probably called from module.lua

[C:\Kepler\1.1\web\ajato_bazaar\dev0\includes\module.lua]
Line 284 : system_get_files_database(files, 'module')
[C:\Kepler\1.1\web\ajato_bazaar\dev0\modules\system\system.module.lua]
Line 145 : function system_get_files_database(files, plugin_type)

When the error occured I had './sites/default/ajato.db' (~6kb)

Related branches

Revision history for this message
George Petsagourakis (petsagouris) wrote :

I checked the batabase ajato.db with this http://www.arkesystems.com/Solutions/Files/Explorer-exe.aspx

It gave me the following contents...

ajato.db
|--batch (table)
   |-- bid (serial)
   |-- timestamp (int)
   |-- token (varchar(64))
   |-- batch (text)
|--history (table)
   |-- nid (int)
   |-- uid (int)
   |-- timestamp (int)

and nothing else.... I don't know why the rest of the tables weren't installed....

Changed in ajato:
assignee: nobody → brmassa
Revision history for this message
George Petsagourakis (petsagouris) wrote :

I did some debugging,...
It has to be the sql queries that are being generated from the db_sqlapi_create_table().

I got this kind of logs,...

Executed sql:
CREATE TABLE sequences (name varchar(255) NOT NULL DEFAULT , id int UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (name))

Error message:
LuaSQL: near ",": syntax error

Revision history for this message
George Petsagourakis (petsagouris) wrote :

Executed sql:
CREATE TABLE sequences (name varchar(255) NOT NULL DEFAULT , id int UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (name))

Error message:
LuaSQL: near ",": syntax error

The problem appears to be in the system.install.lua
The ['default'] = '' part of the values, is _bad_!

it should read ['default'] = '\"\"' so that the sql queries come up like:

CREATE TABLE sequences (name varchar(255) NOT NULL DEFAULT "", id int UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (name))

and not have an sql problem,..

Revision history for this message
Massa (brmassa) wrote :

George,

commited.

regards,

massa

Changed in ajato:
importance: Undecided → Critical
status: New → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.