Bug Report #3729

Bug Report #3587: ORM and sqlite virtual tables not accessed properly breaking object

ORM and sqlite virtual tables not accessed properly breaking object

Added by Jeremy Bush over 1 year ago. Updated 4 months ago.

Status:Closed Start date:01/14/2011
Priority:Normal Due date:
Assignee:Isaiah DeRose-Wilson % Done:

100%

Category:-
Target version:Kohana v3.x - v3.2.1
Resolution:fixed Points:

Description

sqlite has virtual tables which can be used for (amongst other things) powerful full text searches. virtual tables are special in that they don't have any indexes, they don't have any field types, and nor do they have a pk you define. they automatically come with a pk called 'rowid'. the problem is when a user searches on a virtual table using the wildcard *, all fields are returned, EXCEPT the rowid. you need to specifically ask for the rowid should you need it, so: select rowid, * from foo;

This seems to have a knock-on effect for the _loaded property of ORM classes, in that, even if a row is found from something like: ORM::factory('foo')->where('bar', '=', 'asdf')->find(),as the pk isn't returned, _loaded seems to be wrongly set to false, and neither is the pk accessible in the orm object;

as i understand there are two solutions, to not rely on the pk being present for such a situation when setting _loaded, using other fields as well, or, instead of searching with tbl.*, listing each field specifically in the query. as the $_primary_key is specified in the model as 'rowid', it would solve the above problem as the id would be specifically asked for it.


Related issues

related to ORM - Bug Report #4427: ORM and sqlite virtual tables not accessed properly break... Kohana v3.x - v3.3.0 Closed 01/14/2011

History

Updated by Isaiah DeRose-Wilson over 1 year ago

  • Status changed from Review to Assigned
  • Assignee set to Isaiah DeRose-Wilson

Updated by Jeremy Bush about 1 year ago

  • Target version changed from v3.1.1 to v3.1.2

Updated by Jeremy Bush about 1 year ago

  • Target version changed from v3.1.2 to v3.1.3

Updated by Jeremy Bush about 1 year ago

  • Target version changed from v3.1.3 to v3.1.4

Updated by Isaiah DeRose-Wilson 10 months ago

  • Target version changed from v3.1.4 to v3.1.5

Updated by Isaiah DeRose-Wilson 4 months ago

  • Target version changed from v3.1.5 to v3.2.1

Updated by Isaiah DeRose-Wilson 4 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Resolution set to fixed

Fixed by c1d5f2f119...

Also available in: Atom PDF