Fix TC build

This commit is contained in:
Rochet2
2017-06-24 23:22:43 +03:00
parent 6804f6e90f
commit f1117fc2d8
7 changed files with 51 additions and 20 deletions

View File

@@ -303,13 +303,30 @@ namespace LuaQuery
const char* str = row[i].GetCString();
if (row[i].IsNull() || !str)
Eluna::Push(L);
else
{
// MYSQL_TYPE_LONGLONG Interpreted as string for lua
switch (row[i].GetType())
{
case DatabaseFieldTypes::Int8:
case DatabaseFieldTypes::Int16:
case DatabaseFieldTypes::Int32:
case DatabaseFieldTypes::Int64:
case DatabaseFieldTypes::Float:
case DatabaseFieldTypes::Double:
Eluna::Push(L, strtod(str, NULL));
break;
default:
Eluna::Push(L, str);
break;
}
}
#else
Eluna::Push(L, names[i]);
const char* str = row[i].GetString();
if (row[i].IsNULL() || !str)
Eluna::Push(L);
#endif
else
{
// MYSQL_TYPE_LONGLONG Interpreted as string for lua
@@ -328,6 +345,7 @@ namespace LuaQuery
break;
}
}
#endif
lua_rawset(L, tbl);
}