Skip to content

Commit 31734ff

Browse files
committed
change getMessage() API into getErrorMessage() API
1 parent 7c7a090 commit 31734ff

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

src/gstype_php.i

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
%attribute(griddb::ExpirationInfo, int, divisionCount, get_division_count, set_division_count);
4040

4141
// 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;
4443
%rename("%(lowercamelcase)s", %$isfunction) "";
4544

4645
/*
4746
* ignore unnecessary functions
4847
*/
4948
%ignore griddb::ContainerInfo::ContainerInfo(GSContainerInfo* containerInfo);
49+
%ignore griddb::GSException::get_code;
5050

5151
/**
5252
* Support throw exception in PHP language
@@ -320,15 +320,19 @@
320320
case GS_TYPE_BOOL: {
321321
bool boolVal;
322322
boolVal = (bool) zval_is_true(data1);
323-
ret = gsSetRowFieldByLong(row, column, boolVal);
323+
ret = gsSetRowFieldByBool(row, column, boolVal);
324324
}
325325
case GS_TYPE_BYTE: {
326326
int8_t byteVal;
327327
if(Z_TYPE_P(value) != IS_LONG) {
328328
return false;
329329
}
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);
332336
}
333337
case GS_TYPE_SHORT: {
334338
int16_t byteVal;
@@ -346,6 +350,46 @@
346350
intVal = Z_LVAL_P(value);
347351
ret = gsSetRowFieldByInteger(row, column, intVal);
348352
}
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+
}
349393
}
350394
}
351395
}

0 commit comments

Comments
 (0)