|
39 | 39 | %attribute(griddb::ExpirationInfo, int, divisionCount, get_division_count, set_division_count); |
40 | 40 |
|
41 | 41 | // rename all method to camel cases |
42 | | -%rename(getMessageException) griddb::GSException::get_message; |
43 | | -%rename(getCodeException) griddb::GSException::get_code; |
| 42 | +%rename(getErrorMessage) griddb::GSException::get_message; |
44 | 43 | %rename("%(lowercamelcase)s", %$isfunction) ""; |
45 | 44 |
|
46 | 45 | /* |
47 | 46 | * ignore unnecessary functions |
48 | 47 | */ |
49 | 48 | %ignore griddb::ContainerInfo::ContainerInfo(GSContainerInfo* containerInfo); |
| 49 | +%ignore griddb::GSException::get_code; |
50 | 50 |
|
51 | 51 | /** |
52 | 52 | * Support throw exception in PHP language |
|
320 | 320 | case GS_TYPE_BOOL: { |
321 | 321 | bool boolVal; |
322 | 322 | boolVal = (bool) zval_is_true(data1); |
323 | | - ret = gsSetRowFieldByLong(row, column, boolVal); |
| 323 | + ret = gsSetRowFieldByBool(row, column, boolVal); |
324 | 324 | } |
325 | 325 | case GS_TYPE_BYTE: { |
326 | 326 | int8_t byteVal; |
327 | 327 | if(Z_TYPE_P(value) != IS_LONG) { |
328 | 328 | return false; |
329 | 329 | } |
330 | | - shortVal = Z_LVAL_P(value); |
331 | | - ret = gsSetRowFieldByShort(row, column, shortVal); |
| 330 | + byteVal = Z_LVAL_P(value); |
| 331 | + if (byteVal < std::numeric_limits<int8_t>::min() || |
| 332 | + byteVal > std::numeric_limits<int8_t>::max()) { |
| 333 | + return false; |
| 334 | + } |
| 335 | + ret = gsSetRowFieldByByte(row, column, byteVal); |
332 | 336 | } |
333 | 337 | case GS_TYPE_SHORT: { |
334 | 338 | int16_t byteVal; |
|
346 | 350 | intVal = Z_LVAL_P(value); |
347 | 351 | ret = gsSetRowFieldByInteger(row, column, intVal); |
348 | 352 | } |
| 353 | + case GS_TYPE_FLOAT: { |
| 354 | + int32_t intVal; |
| 355 | + if(Z_TYPE_P(value) != IS_LONG) { |
| 356 | + return false; |
| 357 | + } |
| 358 | + intVal = Z_LVAL_P(value); |
| 359 | + ret = gsSetRowFieldByInteger(row, column, intVal); |
| 360 | + } |
| 361 | + case GS_TYPE_DOUBLE: { |
| 362 | + int32_t intVal; |
| 363 | + if(Z_TYPE_P(value) != IS_LONG) { |
| 364 | + return false; |
| 365 | + } |
| 366 | + intVal = Z_LVAL_P(value); |
| 367 | + ret = gsSetRowFieldByInteger(row, column, intVal); |
| 368 | + } |
| 369 | + case GS_TYPE_DOUBLE: { |
| 370 | + int32_t intVal; |
| 371 | + if(Z_TYPE_P(value) != IS_LONG) { |
| 372 | + return false; |
| 373 | + } |
| 374 | + intVal = Z_LVAL_P(value); |
| 375 | + ret = gsSetRowFieldByInteger(row, column, intVal); |
| 376 | + } |
| 377 | + case GS_TYPE_TIMESTAMP: { |
| 378 | + int32_t intVal; |
| 379 | + if(Z_TYPE_P(value) != IS_LONG) { |
| 380 | + return false; |
| 381 | + } |
| 382 | + intVal = Z_LVAL_P(value); |
| 383 | + ret = gsSetRowFieldByInteger(row, column, intVal); |
| 384 | + } |
| 385 | + case GS_TYPE_BLOB: { |
| 386 | + int32_t intVal; |
| 387 | + if(Z_TYPE_P(value) != IS_LONG) { |
| 388 | + return false; |
| 389 | + } |
| 390 | + intVal = Z_LVAL_P(value); |
| 391 | + ret = gsSetRowFieldByInteger(row, column, intVal); |
| 392 | + } |
349 | 393 | } |
350 | 394 | } |
351 | 395 | } |
|
0 commit comments