lua-sql-sqlite3 fails to initialize env object

Bug #1202966 reported by Leonardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lua-sql (Ubuntu)
New
Undecided
Unassigned

Bug Description

Run this piece of code with either lua5.1 or lua5.2 package

#!/usr/bin/lua

require "luasql.sqlite3"

local sql = "SELECT name from names;"
local env = luasql.sqlite3()
local conn = assert (env:connect("names.sql"))
local cursor = assert (conn:execute(sql))

cursor:close()
conn:close()
env:close()

It will invariably fails with:

/usr/bin/lua: ./test:6: attempt to index global 'luasql' (a nil value)
stack traceback:
 ./test:6: in main chunk
 [C]: in ?

Expected behaviour: run without errors.

Thanks!

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: lua-sql-sqlite3 2.3.0-1
ProcVersionSignature: Ubuntu 3.8.0-26.38-generic 3.8.13.2
Uname: Linux 3.8.0-26-generic x86_64
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: amd64
Date: Fri Jul 19 10:12:24 2013
MarkForUpload: True
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lua-sql
UpgradeStatus: Upgraded to raring on 2013-07-17 (1 days ago)

Revision history for this message
Leonardo (rnalrd) wrote :
Revision history for this message
Leonardo (rnalrd) wrote :

I was able to run it on 5.2 by changing:

require "luasql.sqlite3"

to

luasql = require "luasql.sqlite3"

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.