X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fsql_create.c;h=3dcc13c81e5707f5020157a784c0be3289fb7488;hb=2d78ab3b53e7f238d1dfb06420ba403e743f0bb0;hp=1367056d04fb9f78c3a4420f5dcad29e2f84092a;hpb=b4c54e410467daeac1da08865f5ccf7eff25535e;p=bacula%2Fbacula diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 1367056d04..3dcc13c81e 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -6,7 +6,7 @@ The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public + modify it under the terms of version three of the GNU Affero General Public License as published by the Free Software Foundation and included in the file LICENSE. @@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -625,7 +625,7 @@ int db_create_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr) } /* Must create it */ - Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,MinValue,MaxValue,CurrentValue," + Mmsg(mdb->cmd, "INSERT INTO Counters (Counter,\"MinValue\",\"MaxValue\",CurrentValue," "WrapCounter) VALUES ('%s','%d','%d','%d','%s')", cr->Counter, cr->MinValue, cr->MaxValue, cr->CurrentValue, cr->WrapCounter); @@ -1229,7 +1229,6 @@ bool db_create_restore_object_record(JCR *jcr, B_DB *mdb, ROBJECT_DBR *ro) { bool stat; int plug_name_len; - POOLMEM *esc_obj = get_pool_memory(PM_MESSAGE); POOLMEM *esc_plug_name = get_pool_memory(PM_MESSAGE); db_lock(mdb); @@ -1241,8 +1240,7 @@ bool db_create_restore_object_record(JCR *jcr, B_DB *mdb, ROBJECT_DBR *ro) mdb->esc_name = check_pool_memory_size(mdb->esc_name, mdb->fnl*2+1); db_escape_string(jcr, mdb, mdb->esc_name, ro->object_name, mdb->fnl); - esc_obj = check_pool_memory_size(esc_obj, ro->object_len*2+1); - db_escape_string(jcr, mdb, esc_obj, ro->object, ro->object_len); + db_escape_object(jcr, mdb, ro->object, ro->object_len); plug_name_len = strlen(ro->plugin_name); esc_plug_name = check_pool_memory_size(esc_plug_name, plug_name_len*2+1); @@ -1253,7 +1251,7 @@ bool db_create_restore_object_record(JCR *jcr, B_DB *mdb, ROBJECT_DBR *ro) "ObjectLength,ObjectFullLength,ObjectIndex,ObjectType," "ObjectCompression,FileIndex,JobId) " "VALUES ('%s','%s','%s',%d,%d,%d,%d,%d,%d,%u)", - mdb->esc_name, esc_plug_name, esc_obj, + mdb->esc_name, esc_plug_name, mdb->esc_obj, ro->object_len, ro->object_full_len, ro->object_index, FT_RESTORE_FIRST, ro->object_compression, ro->FileIndex, ro->JobId); @@ -1267,7 +1265,6 @@ bool db_create_restore_object_record(JCR *jcr, B_DB *mdb, ROBJECT_DBR *ro) stat = true; } db_unlock(mdb); - free_pool_memory(esc_obj); free_pool_memory(esc_plug_name); return stat; }