78 int p; |
80 int p; |
79 int i; |
81 int i; |
80 int errflag = 0; |
82 int errflag = 0; |
81 const char *errstr = NULL; |
83 const char *errstr = NULL; |
82 SQLRETURN rc = SQL_SUCCESS; |
84 SQLRETURN rc = SQL_SUCCESS; |
83 unsigned char b[1024]; |
85 unsigned char b[BIND_BUFFER_SIZE]; |
84 unsigned char *buffer = &b[0]; |
86 unsigned char *buffer = &b[0]; |
85 int offset = 0; |
87 int offset = 0; |
86 resultset_t *resultset = NULL; |
88 resultset_t *resultset = NULL; |
87 bindparams_t *bind; /* variable to read the results */ |
89 bindparams_t *bind; /* variable to read the results */ |
88 SQLSMALLINT num_params; |
90 SQLSMALLINT num_params; |
114 * with NULLs |
116 * with NULLs |
115 */ |
117 */ |
116 lua_pushboolean(L, 0); |
118 lua_pushboolean(L, 0); |
117 lua_pushfstring(L, DBI_ERR_PARAM_MISCOUNT, num_params, n-1); |
119 lua_pushfstring(L, DBI_ERR_PARAM_MISCOUNT, num_params, n-1); |
118 return 2; |
120 return 2; |
|
121 } |
|
122 |
|
123 if (num_params > (BIND_BUFFER_SIZE/sizeof(double))) { |
|
124 luaL_error(L, "Too many bind params: %d", num_params); |
119 } |
125 } |
120 |
126 |
121 for (p = 2; p <= n; p++) { |
127 for (p = 2; p <= n; p++) { |
122 int i = p - 1; |
128 int i = p - 1; |
123 int type = lua_type(L, p); |
129 int type = lua_type(L, p); |