SELECT * in database
|Assignee:||Carlos Martín||% Done:|
|Target version:||Release 2.2|
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?
#2 Updated by Maciej Nabozny about 9 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?).