Stephane Ducasse wrote:
ah yes. probably a missing rename during the migration to the new ffi.
Stef
Unfortunately there's more: PharoDatabaseAccessor(DatabaseAccessor)>>handleError:for: [ :ex | self handleError: ex for: command ] in [ | result | self checkPermissionFor: command. result := [ (self useBinding and: [ command useBinding ]) ifTrue: [ command executeBoundIn: self ] ifFalse: [ command executeUnboundIn: self ] ] on: Dialect error do: [ :ex | self handleError: ex for: command ]. aBoolean ifTrue: [ result ] ifFalse: [ result upToEnd ] ] in PharoDatabaseAccessor(DatabaseAccessor)>>executeCommand:returnCursor: BlockClosure>>cull: Context>>evaluateSignal: Context>>handleSignal: MessageNotUnderstood(Exception)>>signal ExternalData(Object)>>doesNotUnderstand: #pointerAt: FFIExternalArray class>>fromPointer:type:size: GASqlite3FFI>>blobFrom:at: GASqlite3Statement>>byteArrayAt: GASqlite3Statement>>valueOfColumn: GASqlite3ResultSet>>next GASqlite3ResultSet>>rows GAGlorpDriver>>basicExecuteSQLString: PharoDatabaseAccessor>>basicExecuteSQLString: PharoDatabaseAccessor>>executeCommandUnbound: [..snip..] Now ExternalData does not understand #pointerAt: (only ByteArray and FFIExternalStructureReferenceHandle do, don't know how to fix this quickly... :-( ) Herby
On Sun, Aug 13, 2017 at 9:04 PM, Herby VojÄÃk<herby@mailbox.sk> wrote:
Stephane Ducasse wrote:
Do you have the same bug in 5.0? Because I do not know if garage was really tested on 60.
Don't know (don't have it), but last commit in Garage-SQLite GuillermoPolito.26 from 2016. The mentioned #nbBindingOf: is sent at no place at all in the image (except supersend in the lone method itself), so it definitely looks like it need to rename to ffiBindingOf: for 60.
Herby
Stef
On Sun, Aug 13, 2017 at 8:41 PM, Herby VojÄÃk<herby@mailbox.sk> wrote:
Stephane Ducasse wrote:
Hi Herby
On which version of Pharo are you trying? Because lot of changes happened on Pharo 60 FFI.
Stef
On Sun, Aug 13, 2017 at 6:11 PM, Herby VojÄÃk<herby@mailbox.sk> wrote:
Hello!
This testing code:
| databaseFile login accessor sqlString | databaseFile := Smalltalk imageDirectory asFileReference / 'play.sqlite'. login := Login new database: SQLite3Platform new; host: ''; port: ''; username: ''; password: ''; databaseName: databaseFile fullPath asZnUrl asString; yourself. accessor := DatabaseAccessor forLogin: login. accessor login. sqlString := 'SELECT * FROM AGENT'. (accessor basicExecuteSQLString: sqlString) contents inspect.
fails (Pharo 6.1, GarageGlorp #stable loaded a week ago as a project
As I wrote here, Pharo 6.1.
dependency) with:
Error: Unable to resolve external type: sqlite3
FFICallout(Object)>>error: FFICallout>>resolveType: FFICallout>>typeName:pointerArity: FFICallout>>argName:indirectIndex:type:ptrArity: FFIFunctionParser>>parseArgument FFIFunctionParser>>parseArguments FFIFunctionParser>>parseNamedFunction: FFICalloutMethodBuilder>>parseSignature: FFICalloutMethodBuilder>>generate FFICalloutMethodBuilder>>build: FFICalloutAPI>>function:module: GASqlite3FFI(Object)>>ffiCall:module: GASqlite3FFI>>apiErrorMessage: GASqlite3FFI>>signal:with:on: GASqlite3FFI>>checkForOk:on: GASqlite3FFI>>prepare:on:with: GASqlite3Statement>>prepare GASqlite3Driver>>prepare: GASqlite3ResultSet>>prepareStatement: GASqlite3ResultSet>>execute:withCollection: GASqlite3ResultSet>>execute:with:on: GASqlite3Driver>>execute:with: GASqlite3Driver>>execute: GAGlorpDriver>>basicExecuteSQLString: PharoDatabaseAccessor>>basicExecuteSQLString: UndefinedObject>>DoIt OpalCompiler>>evaluate [..snip..]
Problem seems to be that in FFICallout>> resolveType:, the line
binding := resolver ffiBindingOf: name asSymbol.
actually produces nil, resolver being GASqlite3FFI class. If looking at the class side of GaSqlite3FFI, there is no ffiBindingOf: at all; there is
nbBindingOf: aTypeName ^ TypeMap at: aTypeName ifAbsent: [ super nbBindingOf: aTypeName ]
though. If I copy near-mindlessly and add:
ffiBindingOf: aTypeName ^ TypeMap at: aTypeName ifAbsent: [ super ffiBindingOf: aTypeName ]
then the code above fails correctly with: 'no such table: AGENT'.
Am I missing some nb<->ffi bridge? Or is there a bug in Garage SQLite driver?
Herby