Feature #419

SELECT * in database

Added by Maciej Nabozny almost 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:11/26/2010
Priority:NormalDue date:
Assignee:Carlos Martín% Done:

0%

Category:-
Target version:Release 2.2
Resolution: Pull request:

Description

Hello,
I'm using OpenNebula in my project. I wanted to modify some of it's tables, but there are some problems with database. When I add new field in existing table (e.g. image_pool) listing of images doesn't work no longer. The same problem is with user_pool or vm_pool.

I viewed ONE's source code and I found many SELECT * FROM ..._pool and field names defined as integers (indexes of returned list). The * could be changed to list of fields from database and problem should be fixed. I need to fix this problem by modifying ONE or by my database. Is there any opportunity that you accept my changes in your source code to fix this problem?

Regards,
Maciej Nabozny

Associated revisions

Revision f9902c89
Added by Carlos Martín over 9 years ago

Bug #419: "SELECT *" SQL statement modified to use the column names

History

#1 Updated by Carlos Martín almost 10 years ago

  • Tracker changed from Bug to Request

#2 Updated by Maciej Nabozny almost 10 years ago

I solved this problem by using views in mysql database. I created new table, like image_pool, but with additional fields and changed name. Then i created view, which is selecting only openNebula's fielfs from this table and it is called image_pool, so in fact openNebula uses the view, not real table. Everything works now great, without modifying ONE, but i think, that SELECT * is still a bug (e.g. what will hapen, when somebody make vacuum on sqlite database and order of columns will change?).

Regards,
Maciej Nabozny

#3 Updated by Ruben S. Montero over 9 years ago

  • Assignee set to Carlos Martín
  • Target version set to Release 2.2

#4 Updated by Ruben S. Montero over 9 years ago

  • Status changed from New to Closed

This is now in master. Thanks for your suggestion :)

#5 Updated by Ruben S. Montero over 9 years ago

  • Tracker changed from Request to Feature

Also available in: Atom PDF