Ticket #711 (closed Bug: fixed)

Opened 3 months ago

Last modified 2 months ago

Database set() does not add table prefixes

Reported by: Nowaker Owned by: zombor
Priority: major Milestone: 2.2
Component: Libraries:Database Version: SVN HEAD
Keywords: database insert table prefix Cc:

Description

SQL error after add(). PHP code: http://kohana.pastebin.com/m248cf7b4

Unknown column 'ggalleries_gimages.ggallery_id' in 'field list' - INSERT INTO `k2_ggalleries_gimages` (`ggalleries_gimages`.`ggallery_id`, `ggalleries_gimages`.`gimage_id`) VALUES (2, 9)

As we can see, there is table prefix after the INSERT (INSERT INTO k2_ggalleries_gimages), but in field list it lacks the prefix ((nothing_here)ggalleries_gimages.ggallery_id, (nothing_here)ggalleries_gimages.gimage_id)

Change History

follow-up: ↓ 2   Changed 3 months ago by Shadowhand

  • keywords database insert added; orm add() unknown column lacks removed
  • owner changed from Shadowhand to zombor
  • component changed from Libraries:ORM to Libraries:Database
  • summary changed from New ORM forgets to add table prefix to Database insert() does not add table prefixes

ORM does nothing with table prefixes, that all happens in Database.

in reply to: ↑ 1   Changed 3 months ago by Nowaker

Replying to Shadowhand:

ORM does nothing with table prefixes, that all happens in Database.

I returned back to ORM1 and the problem does not appear (I haven't changed the Database library).

  Changed 2 months ago by zombor

  • summary changed from Database insert() does not add table prefixes to Database set() does not add table prefixes

This is really a problem with the set() function not adding prefixes when the table.column is specified.

  Changed 2 months ago by zombor

  • status changed from new to closed
  • resolution set to fixed

Fixed in r3294.

Note: See TracTickets for help on using tickets.