pike.git / lib / modules / __builtin.pmod / Sql.pmod / Connection.pike

version» Context lines:

pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:377:       array(mapping(string:mixed)) res = ({});    while (res_obj)    {    // Not very efficient, but sufficient    array(string) fieldnames;    array(array(mixed)) rows;    array(mixed) row;    int i;    +  if (arrayp(res_obj)) +  rows = res_obj; +  else { +  fields = 0; +  rows = ({}); +  while (row = res_obj->fetch_row_array()) +  rows += row; +  } +     if (!fields)    fields = res_obj->fetch_fields();    if(!sizeof(fields)) return res;       int has_table = fields[0]->table && fields[0]->table!="";       if(has_table)    fieldnames = (map(fields,    lambda (mapping(string:mixed) m) {    return (m->table||"") + "." + m->name;    }) +    fields->name);    else    fieldnames = fields->name;       if (case_convert)    fieldnames = map(fieldnames, lower_case);    -  if (arrayp(res_obj)) -  rows = res_obj; -  else { -  fields = 0; -  rows = ({}); -  while (row = res_obj->fetch_row_array()) -  rows += row; -  } -  +     if(has_table)    foreach (rows; i; row)    rows[i] = mkmapping(fieldnames, row + row);    else    foreach (rows; i; row)    rows[i] = mkmapping(fieldnames, row);       res += rows;    // Try the next result.    res_obj = objectp(res_obj)
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:545:    continue;    }    if (objectp(s) && s->is_val_null) {    args[j] = .null_arg;    continue;    }    ERROR("Wrong type to query argument %d: %O\n", j + 1, s);    }       query = sprintf(query, @args); -  +     if (sizeof(bindings)) return ({ query, bindings });    return ({ query });   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in untyped mode.   //!   //! @param q   //! Query to send to the SQL-server. This can either be a string with the   //! query, or a previously compiled query (see @[compile_query()]).