pike.git / lib / modules / Sql.pmod / pgsql.pike

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:111:   private object execfetchlimit    =Regexp("^[ \t\f\r\n]*(([Uu][Pp][Dd][Aa]|[Dd][Ee][Ll][Ee])[Tt][Ee]|\   [Ii][Nn][Ss][Ee][Rr][Tt])[ \t\f\r\n]|\   [ \t\f\r\n][Ll][Ii][Mm][Ii][Tt][ \t\f\r\n]+[12][; \t\f\r\n]*$");   Thread.Mutex _querymutex;   Thread.Mutex _stealmutex;      #define USERERROR(msg) throw(({(msg), backtrace()[..<1]}))      protected string _sprintf(int type, void|mapping flags) - { string res=UNDEFINED; + { +  string res=UNDEFINED;    switch(type) -  { case 'O': +  { +  case 'O':    res=sprintf(DRIVERNAME"(%s@%s:%d/%s,%d)",    user,host,port,database,backendpid);    break;    }    return res;   }      #define BOOLOID 16   #define BYTEAOID 17   #define CHAROID 18
pike.git/lib/modules/Sql.pmod/pgsql.pike:1510:   //! This function creates a new database (assuming we   //! have sufficient privileges to do this).   //!   //! @param db   //! Name of the new database.   //!   //! @seealso   //! @[drop_db()]   void create_db(string db)   { -  big_query("CREATE DATABASE :db",([":db":db])); +  big_query(sprintf("CREATE DATABASE %s",db));   }      //! This function destroys a database and all the data it contains (assuming   //! we have sufficient privileges to do so). It is not possible to delete   //! the database you're currently connected to. You can connect to database   //! @expr{"template1"@} to avoid connecting to any live database.   //!   //! @param db   //! Name of the database to be deleted.   //!   //! @seealso   //! @[create_db()]   void drop_db(string db)   { -  big_query("DROP DATABASE :db",([":db":db])); +  big_query(sprintf("DROP DATABASE %s",db));   }      //! @returns   //! A string describing the server we are   //! talking to. It has the form @expr{"servername/serverversion"@}   //! (like the HTTP protocol description) and is most useful in   //! conjunction with the generic SQL-server module.   //!   //! @seealso   //! @[host_info()]