File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,17 @@ void async_postgres::create_result_table(GLua::ILuaInterface* lua,
43
43
lua->PushNumber (i + 1 );
44
44
lua->CreateTable ();
45
45
for (int j = 0 ; j < nFields; j++) {
46
- lua-> PushString (fields[j]. name );
46
+ // skip NULL values
47
47
if (!PQgetisnull (result, i, j)) {
48
- if (fields[j]. text ) {
49
- lua->PushString (PQgetvalue (result, i, j) );
50
- } else {
51
- lua-> PushString ( PQgetvalue (result, i, j),
52
- PQgetlength ( result, i, j));
53
- }
54
- } else {
55
- lua->PushNil ( );
48
+ // field name
49
+ lua->PushString (fields[j]. name );
50
+
51
+ // field value
52
+ lua-> PushString ( PQgetvalue ( result, i, j),
53
+ PQgetlength (result, i, j));
54
+
55
+ lua->SetTable (- 3 );
56
56
}
57
- lua->SetTable (-3 );
58
57
}
59
58
lua->SetTable (-3 );
60
59
}
You can’t perform that action at this time.
0 commit comments