Changeset 860 for branches/prototype-v0/zoo-project/zoo-kernel/sqlapi.c
- Timestamp:
- Dec 12, 2017, 4:09:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/sqlapi.c
r854 r860 121 121 int _init_sql(maps* conf,const char* key){ 122 122 char* sqlInitString=_createInitString(conf,key); 123 #ifdef SQL_DEBUG 123 124 fprintf(stderr,"Try to connect to: %s %s !\n",key,sqlInitString); 124 125 fflush(stderr); 126 #endif 125 127 if(strncmp(sqlInitString,"-1",2)==0) 126 128 return -1; 127 fprintf(stderr,"Try to connect to: %s !\n",key);128 fflush(stderr);129 129 OGRSFDriver *poDriver = NULL; 130 130 OGRRegisterAll(); … … 165 165 #endif 166 166 if( zoo_DS[zoo_ds_nb] == NULL ){ 167 #ifdef DEBUG167 #ifdef SQL_DEBUG 168 168 fprintf(stderr,"sqlInitString: %s FAILED !\n",sqlInitString); 169 169 fflush(stderr); … … 174 174 return -2; 175 175 } 176 #ifdef DEBUG176 #ifdef SQL_DEBUG 177 177 fprintf(stderr,"sqlInitString: %s SUCEED !\n",sqlInitString); 178 178 fflush(stderr); 179 179 #endif 180 fprintf(stderr,"sqlInitString: %s SUCEED %d !\n",sqlInitString,zoo_ds_nb);181 fflush(stderr);182 180 free(sqlInitString); 183 181 zoo_ds_nb++; … … 234 232 return NULL; 235 233 OGRLayer *res=NULL; 236 #ifdef DEBUG234 #ifdef SQL_DEBUG 237 235 fprintf(stderr,"************************* %s %s %d\n\n",sqlQuery,__FILE__,__LINE__); 238 236 fflush(stderr); … … 381 379 char *sqlQuery=(char*)malloc((strlen(schema->value)+strlen(msg->value)+strlen(p->value)+strlen(sid->value)+64+1)*sizeof(char)); 382 380 sprintf(sqlQuery,"UPDATE %s.services set status=$$%s$$,message=$$%s$$ where uuid=$$%s$$;",schema->value,p->value,msg->value,sid->value); 383 if(zoo_ds_nb==0){ 381 if( zoo_ds_nb== 382 #ifdef META_DB 383 1 384 #else 385 0 386 #endif 387 ){ 384 388 init_sql(conf); 385 389 zoo_ds_nb++;
Note: See TracChangeset
for help on using the changeset viewer.