Skip to content
Snippets Groups Projects
Commit ff9f5d06 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

big_query() now actually supports returning 0.

Rev: lib/modules/Sql.pmod/sql.pike:1.22
parent 6f1fc870
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: sql.pike,v 1.21 1998/06/17 12:48:00 grubba Exp $ * $Id: sql.pike,v 1.22 1998/06/17 12:58:34 grubba Exp $
* *
* Implements the generic parts of the SQL-interface * Implements the generic parts of the SQL-interface
* *
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
//. //.
//. File: sql.pike //. File: sql.pike
//. RCSID: $Id: sql.pike,v 1.21 1998/06/17 12:48:00 grubba Exp $ //. RCSID: $Id: sql.pike,v 1.22 1998/06/17 12:58:34 grubba Exp $
//. Author: Henrik Grubbström (grubba@idonex.se) //. Author: Henrik Grubbström (grubba@idonex.se)
//. //.
//. Synopsis: Implements the generic parts of the SQL-interface. //. Synopsis: Implements the generic parts of the SQL-interface.
...@@ -282,8 +282,6 @@ string|object compile_query(string q) ...@@ -282,8 +282,6 @@ string|object compile_query(string q)
array(mapping(string:mixed)) query(object|string q, array(mapping(string:mixed)) query(object|string q,
mapping(string|int:mixed)|void bindings) mapping(string|int:mixed)|void bindings)
{ {
object res_obj;
if (functionp(master_sql->query)) { if (functionp(master_sql->query)) {
if (bindings) { if (bindings) {
return(master_sql->query(q, bindings)); return(master_sql->query(q, bindings));
...@@ -314,18 +312,21 @@ array(mapping(string:mixed)) query(object|string q, ...@@ -314,18 +312,21 @@ array(mapping(string:mixed)) query(object|string q,
//. is used. Binary values (BLOBs) may need to be placed in multisets. //. is used. Binary values (BLOBs) may need to be placed in multisets.
object big_query(object|string q, mapping(string|int:mixed)|void bindings) object big_query(object|string q, mapping(string|int:mixed)|void bindings)
{ {
object|array(mapping) pre_res;
if (functionp(master_sql->big_query)) { if (functionp(master_sql->big_query)) {
if (bindings) { if (bindings) {
return(Sql.sql_result(master_sql->big_query(q, bindings))); pre_res = master_sql->big_query(q, bindings);
} else { } else {
return(Sql.sql_result(master_sql->big_query(q))); pre_res = master_sql->big_query(q);
} }
} }
if (bindings) { if (bindings) {
return(Sql.sql_result(master_sql->query(q, bindings))); pre_res = master_sql->query(q, bindings);
} else { } else {
return(Sql.sql_result(master_sql->query(q))); pre_res = master_sql->query(q);
} }
return(pre_res && Sql.sql_result(pre_res));
} }
//. - create_db //. - create_db
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment