summaryrefslogtreecommitdiff
path: root/src/common/sql.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-30 18:21:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-30 20:37:26 +0300
commit2000a698da35915afb1a598433337a735d27ae24 (patch)
tree119c8d409657cee1d90cd0c072ef3b7e846fa3f0 /src/common/sql.c
parent84ecefb4db23bbd98194a43a592cfe313477a1ab (diff)
downloadhercules-2000a698da35915afb1a598433337a735d27ae24.tar.gz
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.bz2
hercules-2000a698da35915afb1a598433337a735d27ae24.tar.xz
hercules-2000a698da35915afb1a598433337a735d27ae24.zip
Add different fixes for gcc 7 warnings.
Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings.
Diffstat (limited to 'src/common/sql.c')
-rw-r--r--src/common/sql.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/sql.c b/src/common/sql.c
index be0bd43e3..7e3e2e46f 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -422,39 +422,48 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
break;
// fixed size
case SQLDT_UINT8: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT8: bind->buffer_type = MYSQL_TYPE_TINY;
buffer_len = 1;
break;
case SQLDT_UINT16: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT16: bind->buffer_type = MYSQL_TYPE_SHORT;
buffer_len = 2;
break;
case SQLDT_UINT32: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT32: bind->buffer_type = MYSQL_TYPE_LONG;
buffer_len = 4;
break;
case SQLDT_UINT64: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT64: bind->buffer_type = MYSQL_TYPE_LONGLONG;
buffer_len = 8;
break;
// platform dependent size
case SQLDT_UCHAR: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_CHAR: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(char));
buffer_len = sizeof(char);
break;
case SQLDT_USHORT: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_SHORT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(short));
buffer_len = sizeof(short);
break;
case SQLDT_UINT: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int));
buffer_len = sizeof(int);
break;
case SQLDT_ULONG: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_LONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long));
buffer_len = sizeof(long);
break;
case SQLDT_ULONGLONG: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int64));
buffer_len = sizeof(int64);
break;