summaryrefslogtreecommitdiff
path: root/community/gambas2/db.firebird.gcc-4.6.0-fix.patch
blob: 0b6e68df3364156e492fe4fc6dcf499f06490c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- gambas/branches/2.0/gb.db.firebird/src/main.cpp	2011/05/27 15:01:54	3864
+++ gambas/branches/2.0/gb.db.firebird/src/main.cpp	2011/05/27 15:26:41	3865
@@ -1216,7 +1216,8 @@
         GB.StoreVariant(&fantom, &buffer[i]);
       }
       else{
-        GB.StoreVariant(&res->GetData(pos,i), &buffer[i]);
+	GB_VARIANT val = res->GetData(pos,i);
+        GB.StoreVariant(&val , &buffer[i]);
       }
     }
   }
@@ -1874,6 +1875,8 @@
   static char query[SQLMAXLEN];
   int type;
   std::string str1,str2;
+  GB_VARIANT varval;
+  char* charval;
   snprintf(query,SQLMAXLEN-1,"select b.RDB$field_name,a.RDB$field_type,b.rdb$null_flag,b.rdb$default_source,a.RDB$field_length from RDB$fields a,RDB$relation_fields b where a.RDB$field_name=b.RDB$field_source and b.RDB$relation_name=upper('%s') and b.rdb$field_name=upper('%s')",table,field);
   if (do_query(db, query, &res, "Unable to get the field from the table")){
     delete res;
@@ -1900,9 +1903,11 @@
     str1=res->GetData(0,3).value.value._string;
   if(str1!="")
     str2=str1.assign(str1,8,str1.length()-8);
-  GB.FreeString(&res->GetData(0,3).value.value._string);
+  charval = res->GetData(0,3).value.value._string;
+  GB.FreeString(&charval);
   res->SetData(0,3,str2);
-  GB.StoreVariant(&res->GetData(0,3), &info->def);
+  varval = res->GetData(0,3);
+  GB.StoreVariant(&varval, &info->def);
   }
   delete res;
   return FALSE;