InfiniSQL
v0.1.2-alpha
Massive Scale Transaction Processing
|
object that handles SQL activities More...
#include <Pg.h>
Public Types | |
enum | states_e { STATE_NONE = 0, STATE_BEGIN, STATE_AUTH, STATE_ESTABLISHED, STATE_ABORTED, STATE_EXITING } |
states for an SQL connection More... | |
Public Member Functions | |
Pg (class TransactionAgent *entrypoint, int statePtr) | |
virtual | ~Pg () |
void | doit () |
void | continueFunc1 (int64_t entrypoint, void *statePtr) |
user-defined continuation function More... | |
void | continueFunc2 (int64_t entrypoint, void *statePtr) |
second user-defined continuation function More... | |
void | continuePgFunc (int64_t entrypoint, void *statePtr) |
after SQL activity is performed More... | |
void | continuePgCommitimplicit (int64_t entrypoint, void *statePtr) |
continuation function after implicit commit More... | |
void | continuePgCommitexplicit (int64_t entrypoint, void *statePtr) |
continuation function after explicit commit More... | |
void | continuePgRollbackimplicit (int64_t entrypoint, void *statePtr) |
continuation function after implicit rollback More... | |
void | continuePgRollbackexplicit (int64_t entrypoint, void *statePtr) |
continuation function after explicit rollback More... | |
bool | readsocket (string &buf) |
read from socket More... | |
void | closesocket (class TransactionAgent &taRef) |
close socket More... | |
void | cont () |
wire protocol handling More... | |
short | initcmd (string &newdata) |
read new command from socket More... | |
void | replymsg () |
put message for reply into outbound buffer More... | |
short | writesocket () |
write response messages to socket More... | |
short | rewritesocket () |
write stored buffer to socket More... | |
bool | get (int16_t *val) |
read 16bit integer from inbound message string More... | |
bool | get (int32_t *val) |
read 32bit integer from inbound message string More... | |
bool | get (int64_t *val) |
read 64bit integer from inbound message string More... | |
bool | get (vector< int16_t > &val, size_t nelem) |
read list of 16bit integers from inbound message string More... | |
bool | get (vector< int32_t > &val, size_t nelem) |
read array of 32bit integers from inbound message string More... | |
bool | get (vector< int64_t > &val, size_t nelem) |
read array of 64bit integers inbound message string More... | |
bool | get (char *val) |
read Byte1 from inbound message string More... | |
bool | get (string &val, size_t nelem) |
read Byten from inbound message string More... | |
bool | get (string &val) |
read String (c-style) from inbound message string More... | |
void | put (int16_t val) |
write data to outbound message buffer More... | |
void | put (int32_t val) |
write data to outbound message buffer More... | |
void | put (int64_t val) |
write data to outbound message buffer More... | |
void | put (vector< int16_t > &val) |
write data to outbound message buffer More... | |
void | put (vector< int32_t > &val) |
write data to outbound message buffer More... | |
void | put (vector< int64_t > &val) |
write data to outbound message buffer More... | |
void | put (char val) |
write data to outbound message buffer More... | |
void | put (char *val, size_t nelem) |
write Byten to outbound message buffer More... | |
void | put (string &val) |
write data to outbound message buffer More... | |
void | put (char *val) |
write data to outbound message buffer More... | |
void | putCommandComplete (char *tag) |
write completed command to outbound message buffer More... | |
void | putErrorResponse (char *severity, char *code, char *message) |
write error to outbound message buffer More... | |
void | putNoticeResponse (char *severity, char *code, char *message) |
write notice to outbound message buffer More... | |
void | putRowDescription () |
write field names to outbound message buffer More... | |
void | putDataRows () |
write rows to outbound message buffer More... | |
void | putAuthenticationOk () |
write authenticationok status to outbound message buffer More... | |
void | putParameterStatus (char *name, char *value) |
write server parameters in status message to outbound message buffer More... | |
void | sqlcommitimplicit () |
implicit commit More... | |
void | sqlcommitexplicit () |
explicit commit More... | |
void | sqlrollbackimplicit () |
implicit rollback More... | |
void | sqlrollbackexplicit () |
explicit rollback More... | |
bool | sqlbegin () |
appears to be orphan More... | |
void | continueLogin (int cmdstate, class MessageUserSchema &msgrcvref) |
continuation after login operation More... | |
void | executeStatement (string &stmtstr) |
tokenize, parse, compile and execute SQL query More... | |
void | errorStatus (int64_t status) |
output error based on Transaction::resultCode More... | |
Public Member Functions inherited from ApiInterface | |
ApiInterface () | |
virtual | ~ApiInterface () |
void | deserialize2Vector () |
orphan More... | |
void | beginTransaction () |
start Transaction More... | |
void | destruct () |
orphan More... | |
void | bouncebackproxy () |
orphan More... | |
void | insertRow (apifPtr re, int64_t recmd, void *reptr, int64_t tableid) |
deprecated More... | |
void | deleteRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur) |
deprecated More... | |
void | replaceRow (apifPtr re, int64_t recmd, void *reptr) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, int64_t input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, uint64_t input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, bool input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, long double input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, char input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, string *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< int64_t > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< uint64_t > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< bool > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< long double > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< char > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, vector< string > *input) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, int64_t lower, int64_t upper) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, uint64_t lower, uint64_t upper) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, bool lower, bool upper) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, long double lower, long double upper) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, char lower, char upper) |
deprecated More... | |
void | selectRows (apifPtr re, int64_t recmd, void *reptr, int64_t tableid, int64_t fieldid, locktype_e locktype, operatortypes_e op, string *lower, string *upper) |
deprecated More... | |
void | fetchRows (apifPtr re, int64_t recmd, void *reptr) |
deprecated More... | |
void | unlock (apifPtr re, int64_t recmd, void *reptr, int64_t rowid, int64_t tableid, int64_t engineid) |
unlock row More... | |
void | rollback (apifPtr re, int64_t recmd, void *reptr) |
rollback transaction More... | |
void | rollback (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur) |
rollback transaction More... | |
void | commit (apifPtr re, int64_t recmd, void *reptr) |
commit transaction More... | |
void | revert (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur) |
deprecated More... | |
void | updateRowNullField (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, int64_t input) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, uint64_t input) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, bool input) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, long double input) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, char input) |
deprecated More... | |
void | updateRow (apifPtr re, int64_t recmd, void *reptr, uuRecord_s &uur, int64_t fieldid, string input) |
deprecated More... | |
bool | unmakerow (int64_t tableid, string *rowstring, vector< fieldValue_s > *resultFields) |
deprecated More... | |
void | prepareResponseVector (int64_t resultCode) |
deprecated More... | |
void | addFieldToRow () |
deprecated More... | |
void | addFieldToRow (int64_t val) |
deprecated More... | |
void | addFieldToRow (uint64_t val) |
deprecated More... | |
void | addFieldToRow (bool val) |
deprecated More... | |
void | addFieldToRow (long double val) |
deprecated More... | |
void | addFieldToRow (char val) |
deprecated More... | |
void | addFieldToRow (string &val) |
deprecated More... | |
void | setReEntry (apifPtr re, int64_t recmd, void *reptr) |
set continuation target back to ApiInterface object More... | |
void | sendResponse (int64_t resultCode, vector< std::string > *v) |
deprecated More... | |
bool | execStatement (const char *stmtname, Statement *stmtPtr, apifPtr reentryfunction, int64_t reentrypoint, void *reentrydata) |
execute SQL statement More... | |
bool | execStatement (const char *stmtname, vector< std::string > &args, apifPtr reentryfunction, int64_t reentrypoint, void *reentrydata) |
execute SQL statement More... | |
int64_t | getResultCode () |
get resultCode from most recent transactional activity More... | |
void | deleteTransaction () |
delete Transaction More... | |
void | deleteStatement () |
delete Statement More... | |
void | getStoredProcedureArgs (Statement *stmtPtr, std::vector< std::string > &argsRef) |
put args from stored procedure Statement into vector of strings More... | |
Static Public Member Functions | |
static void | pgclosesocket (class TransactionAgent &taRef, int socketfd) |
more socket closing-related activities More... | |
Public Attributes | |
states_e | state |
int | sockfd |
char | pgcmdtype |
uint32_t | size |
std::string | inbuf |
size_t | pos |
char | outcmd |
std::string | outmsg |
std::string | outbuf |
int64_t | userid |
class Schema * | schemaPtr |
boost::unordered_map < std::string, std::string > | startupArgs |
std::string | procedureprefix |
bool | session_isautocommit |
bool | command_autocommit |
bool | isintransactionblock |
Public Attributes inherited from ApiInterface | |
class TransactionAgent * | taPtr |
class ApiInterface * | pgPtr |
class Statement * | statementPtr |
std::vector< std::string > | inputVector |
class Transaction * | transactionPtr |
procedureResponse_s | response |
std::vector< std::string > | responseVector |
void * | destroyerPtr |
apifPtr | continueFunc1Ptr |
apifPtr | continueFunc2Ptr |
apifPtr | continuePgFuncPtr |
int | sockfd |
int64_t | domainid |
results_s | results |
object that handles SQL activities
implements PostgreSQL frontend/backend protocol, version 3: http://www.postgresql.org/docs/7.4/static/protocol.html
entrypoint | |
statePtr |
enum Pg::states_e |
Pg::Pg | ( | class TransactionAgent * | entrypoint, |
int | statePtr | ||
) |
Definition at line 37 of file Pg.cc.
References ApiInterface::domainid, TransactionAgent::Pgs, sockfd, ApiInterface::statementPtr, ApiInterface::taPtr, and ApiInterface::transactionPtr.
void Pg::closesocket | ( | class TransactionAgent & | taRef) |
close socket
taRef | TransactionAgent |
Definition at line 372 of file Pg.cc.
References ApiInterface::continuePgCommitimplicit(), pgclosesocket(), Transaction::reentryCmd, Transaction::reentryFuncPtr, Transaction::reentryObject, Transaction::reentryState, Transaction::rollback(), sockfd, state, STATE_EXITING, ApiInterface::statementPtr, and ApiInterface::transactionPtr.
Referenced by cont(), continuePgCommitexplicit(), continuePgCommitimplicit(), continuePgFunc(), continuePgRollbackexplicit(), putAuthenticationOk(), and putErrorResponse().
void Pg::cont | ( | ) |
wire protocol handling
called by TransactionAgent when incoming socket reads ready
Definition at line 55 of file Pg.cc.
References MessageUserSchema::userschema_s::caller, MessageUserSchema::userschema_s::callerstate, closesocket(), CMD_COMMIT, CMD_ROLLBACK, MessageUserSchema::domainname, MessageSocket::socket_s::events, executeStatement(), inbuf, initcmd(), isintransactionblock, TransactionAgent::msgrcv, OPERATION_LOGIN, Operation::operationid, MessageUserSchema::userschema_s::operationid, MessageUserSchema::userschema_s::operationtype, outbuf, outcmd, MessageUserSchema::password, pgcmdtype, pos, put(), putCommandComplete(), putErrorResponse(), Statement::queries, readsocket(), replymsg(), rewritesocket(), schemaPtr, size, MessageSocket::socketStruct, Operation::sockfd, sockfd, startupArgs, state, STATE_ABORTED, STATE_AUTH, STATE_BEGIN, STATE_ESTABLISHED, STATE_EXITING, Larxer::statementPtr, ApiInterface::statementPtr, ApiInterface::taPtr, MessageUserSchema::username, MessageUserSchema::userschemaStruct, and writesocket().
|
inlinevirtual |
user-defined continuation function
entrypoint | entrypoint for continuation |
statePtr | state data |
Implements ApiInterface.
|
inlinevirtual |
second user-defined continuation function
entrypoint | entrypoint for continuation |
statePtr | state data |
Implements ApiInterface.
void Pg::continueLogin | ( | int | cmdstate, |
class MessageUserSchema & | msgrcvref | ||
) |
continuation after login operation
cmdstate | function state to continue |
msgrcvref | reply MessageUserSchema |
Definition at line 817 of file Pg.cc.
References MessageUserSchema::userschema_s::domainid, ApiInterface::domainid, TransactionAgent::domainidsToSchemata, MessageUserSchema::domainname, procedureprefix, putAuthenticationOk(), putErrorResponse(), schemaPtr, MessageUserSchema::userschema_s::status, STATUS_OK, storedprocprefix, ApiInterface::taPtr, MessageUserSchema::userschema_s::userid, userid, and MessageUserSchema::userschemaStruct.
Referenced by Operation::handleOperation().
|
virtual |
continuation function after explicit commit
explicit commit is sent as COMMIT or END at end of transaction
entrypoint | entry point to continue |
statePtr | state data to continue with |
Implements ApiInterface.
Definition at line 1446 of file Pg.cc.
References closesocket(), logfile, outbuf, putCommandComplete(), state, STATE_EXITING, ApiInterface::statementPtr, ApiInterface::taPtr, ApiInterface::transactionPtr, and writesocket().
Referenced by sqlcommitexplicit().
|
virtual |
continuation function after implicit commit
implicit commit done after a single statement is entered, not in a transaction already, and session_isautocommit is true
entrypoint | entry point to continue |
statePtr | state data to continue with |
Implements ApiInterface.
Definition at line 1420 of file Pg.cc.
References closesocket(), logfile, state, STATE_EXITING, ApiInterface::statementPtr, ApiInterface::taPtr, ApiInterface::transactionPtr, and writesocket().
Referenced by sqlcommitimplicit().
|
virtual |
after SQL activity is performed
based on the statement type and transaction state, a variety of things if session_isautocommit==true, and is SELECT, INSERT, UPDATE, DELETE, then output If autocommit==false, and SELECT, INSERT, UPDATE, DELETE, then prepare output but don't output if COMMIT (END), then commit open transaction and output results already prepared if ROLLBACK, then rollback open transaction and output results CommandComplete at the end of everything returned If set, then set whatever
entrypoint | entry point to contiue |
statePtr | state data to continue with |
Implements ApiInterface.
Definition at line 876 of file Pg.cc.
References closesocket(), CMD_BEGIN, CMD_COMMIT, CMD_DELETE, CMD_INSERT, CMD_ROLLBACK, CMD_SELECT, CMD_SET, CMD_STOREDPROCEDURE, CMD_UPDATE, ApiInterface::results_s::cmdtype, command_autocommit, errorStatus(), isintransactionblock, logfile, putCommandComplete(), putDataRows(), putNoticeResponse(), putRowDescription(), ApiInterface::results, ApiInterface::results_s::selectResults, session_isautocommit, sqlcommitexplicit(), sqlcommitimplicit(), sqlrollbackexplicit(), sqlrollbackimplicit(), state, STATE_EXITING, ApiInterface::results_s::statementResults, ApiInterface::results_s::statementStatus, STATUS_NOTOK, STATUS_OK, ApiInterface::taPtr, ApiInterface::results_s::transactionPtr, ApiInterface::transactionPtr, and writesocket().
|
virtual |
continuation function after explicit rollback
explicit commit is sent as ROLLBACK statement within transaction
entrypoint | entry point to continue |
statePtr | state data to continue with |
Implements ApiInterface.
Definition at line 1499 of file Pg.cc.
References closesocket(), logfile, outbuf, putCommandComplete(), state, STATE_EXITING, ApiInterface::statementPtr, ApiInterface::taPtr, ApiInterface::transactionPtr, and writesocket().
Referenced by sqlrollbackexplicit().
|
virtual |
continuation function after implicit rollback
implicit rollback done generally after a failure of some kind which forces a rollback
entrypoint | entry point to continue |
statePtr | state data to continue with |
Implements ApiInterface.
Definition at line 1476 of file Pg.cc.
References logfile, outbuf, state, STATE_EXITING, ApiInterface::statementPtr, and ApiInterface::transactionPtr.
Referenced by sqlrollbackimplicit().
|
inlinevirtual |
void Pg::errorStatus | ( | int64_t | status) |
output error based on Transaction::resultCode
status | value from Transaction::resultCode |
Definition at line 1595 of file Pg.cc.
References APISTATUS_LOCK, APISTATUS_NOTOK, APISTATUS_UNIQUECONSTRAINT, and putErrorResponse().
Referenced by continuePgFunc().
void Pg::executeStatement | ( | string & | stmtstr) |
tokenize, parse, compile and execute SQL query
stmtstr | query string |
Definition at line 836 of file Pg.cc.
References CMD_STOREDPROCEDURE, command_autocommit, ApiInterface::continuePgFunc(), Statement::execute(), procedureprefix, putErrorResponse(), Statement::queries, Statement::resolveTableFields(), ApiInterface::results, schemaPtr, sqlrollbackimplicit(), Larxer::statementPtr, ApiInterface::statementPtr, ApiInterface::taPtr, and ApiInterface::transactionPtr.
Referenced by cont().
bool Pg::get | ( | int16_t * | val) |
bool Pg::get | ( | int32_t * | val) |
bool Pg::get | ( | int64_t * | val) |
bool Pg::get | ( | vector< int16_t > & | val, |
size_t | nelem | ||
) |
bool Pg::get | ( | vector< int32_t > & | val, |
size_t | nelem | ||
) |
bool Pg::get | ( | vector< int64_t > & | val, |
size_t | nelem | ||
) |
bool Pg::get | ( | char * | val) |
bool Pg::get | ( | string & | val, |
size_t | nelem | ||
) |
bool Pg::get | ( | string & | val) |
short Pg::initcmd | ( | string & | newdata) |
read new command from socket
newdata | buffer for command string |
Definition at line 416 of file Pg.cc.
References inbuf, logfile, pgcmdtype, size, sockfd, state, and STATE_BEGIN.
Referenced by cont().
|
static |
more socket closing-related activities
taRef | TransactionAgent |
socketfd | socket descriptor |
Definition at line 394 of file Pg.cc.
References connectionsMutex, Topology::partitionAddress::epollfd, LISTENER_NONE, listenerTypes, logfile, TransactionAgent::myIdentity, NUMSOCKETS, TransactionAgent::Pgs, and socketAffinity.
Referenced by closesocket(), and TransactionAgent::TransactionAgent().
void Pg::put | ( | int16_t | val) |
write data to outbound message buffer
val | 16bit integer |
Definition at line 625 of file Pg.cc.
References outmsg.
Referenced by cont(), putAuthenticationOk(), putCommandComplete(), putDataRows(), putErrorResponse(), putNoticeResponse(), putParameterStatus(), putRowDescription(), and writesocket().
void Pg::put | ( | int32_t | val) |
void Pg::put | ( | int64_t | val) |
void Pg::put | ( | vector< int16_t > & | val) |
void Pg::put | ( | vector< int32_t > & | val) |
void Pg::put | ( | vector< int64_t > & | val) |
void Pg::put | ( | char | val) |
void Pg::put | ( | char * | val, |
size_t | nelem | ||
) |
void Pg::put | ( | string & | val) |
void Pg::put | ( | char * | val) |
void Pg::putAuthenticationOk | ( | ) |
write authenticationok status to outbound message buffer
Definition at line 1542 of file Pg.cc.
References closesocket(), inbuf, outcmd, put(), putParameterStatus(), replymsg(), size, startupArgs, state, STATE_ESTABLISHED, ApiInterface::taPtr, and writesocket().
Referenced by continueLogin().
void Pg::putCommandComplete | ( | char * | tag) |
write completed command to outbound message buffer
tag | command name |
Definition at line 1134 of file Pg.cc.
References outcmd, put(), and replymsg().
Referenced by cont(), continuePgCommitexplicit(), continuePgFunc(), and continuePgRollbackexplicit().
void Pg::putDataRows | ( | ) |
write rows to outbound message buffer
Definition at line 1316 of file Pg.cc.
References BOOL, CHAR, CHARX, Transaction::fieldValues, FLOAT, INT, outcmd, put(), replymsg(), ApiInterface::results, ApiInterface::results_s::selectFields, ApiInterface::results_s::selectResults, UINT, and VARCHAR.
Referenced by continuePgFunc().
void Pg::putErrorResponse | ( | char * | severity, |
char * | code, | ||
char * | message | ||
) |
write error to outbound message buffer
severity | error severity |
code | error code |
message | error message |
Definition at line 1141 of file Pg.cc.
References closesocket(), outcmd, put(), replymsg(), ApiInterface::taPtr, and writesocket().
Referenced by cont(), continueLogin(), errorStatus(), and executeStatement().
void Pg::putNoticeResponse | ( | char * | severity, |
char * | code, | ||
char * | message | ||
) |
write notice to outbound message buffer
severity | notice severity |
code | notice code |
message | notice message |
Definition at line 1160 of file Pg.cc.
References outcmd, put(), and replymsg().
Referenced by continuePgFunc().
void Pg::putParameterStatus | ( | char * | name, |
char * | value | ||
) |
write server parameters in status message to outbound message buffer
name | parameter name |
value | parameter value |
Definition at line 1587 of file Pg.cc.
References outcmd, put(), and replymsg().
Referenced by putAuthenticationOk().
void Pg::putRowDescription | ( | ) |
write field names to outbound message buffer
Definition at line 1254 of file Pg.cc.
References BOOL, BOOLOID, BPCHAROID, CHAR, CHAROID, CHARX, FLOAT, FLOAT8OID, INT, INT8OID, outcmd, put(), replymsg(), ApiInterface::results, ApiInterface::results_s::selectFields, UINT, VARCHAR, and VARCHAROID.
Referenced by continuePgFunc().
bool Pg::readsocket | ( | string & | buf) |
void Pg::replymsg | ( | ) |
put message for reply into outbound buffer
Definition at line 718 of file Pg.cc.
References outbuf, outcmd, and outmsg.
Referenced by cont(), putAuthenticationOk(), putCommandComplete(), putDataRows(), putErrorResponse(), putNoticeResponse(), putParameterStatus(), putRowDescription(), and writesocket().
short Pg::rewritesocket | ( | ) |
write stored buffer to socket
called after socket becomes writable
Definition at line 789 of file Pg.cc.
References Topology::partitionAddress::epollfd, TransactionAgent::myIdentity, sockfd, ApiInterface::taPtr, and writesocket().
Referenced by cont().
bool Pg::sqlbegin | ( | ) |
appears to be orphan
Definition at line 1243 of file Pg.cc.
References ApiInterface::transactionPtr.
void Pg::sqlcommitexplicit | ( | ) |
explicit commit
explicit commit is sent as COMMIT or END at end of transaction
Definition at line 1190 of file Pg.cc.
References Transaction::commit(), continuePgCommitexplicit(), ApiInterface::continuePgCommitexplicit(), Transaction::reentryCmd, Transaction::reentryFuncPtr, Transaction::reentryObject, Transaction::reentryState, and ApiInterface::transactionPtr.
Referenced by continuePgFunc().
void Pg::sqlcommitimplicit | ( | ) |
implicit commit
implicit commit done after a single statement is entered, not in a transaction already, and session_isautocommit is true
Definition at line 1174 of file Pg.cc.
References Transaction::commit(), continuePgCommitimplicit(), ApiInterface::continuePgCommitimplicit(), Transaction::reentryCmd, Transaction::reentryFuncPtr, Transaction::reentryObject, Transaction::reentryState, and ApiInterface::transactionPtr.
Referenced by continuePgFunc().
void Pg::sqlrollbackexplicit | ( | ) |
explicit rollback
explicit commit is sent as ROLLBACK statement within transaction
Definition at line 1227 of file Pg.cc.
References continuePgRollbackexplicit(), ApiInterface::continuePgRollbackexplicit(), Transaction::reentryCmd, Transaction::reentryFuncPtr, Transaction::reentryObject, Transaction::reentryState, Transaction::rollback(), and ApiInterface::transactionPtr.
Referenced by continuePgFunc().
void Pg::sqlrollbackimplicit | ( | ) |
implicit rollback
implicit rollback done generally after a failure of some kind which forces a rollback
Definition at line 1206 of file Pg.cc.
References continuePgRollbackimplicit(), ApiInterface::continuePgRollbackimplicit(), isintransactionblock, Transaction::reentryCmd, Transaction::reentryFuncPtr, Transaction::reentryObject, Transaction::reentryState, Transaction::rollback(), state, STATE_ABORTED, and ApiInterface::transactionPtr.
Referenced by continuePgFunc(), and executeStatement().
short Pg::writesocket | ( | ) |
write response messages to socket
if not all data can be written, store data until EPOLLOUT event is received
Definition at line 731 of file Pg.cc.
References Topology::partitionAddress::epollfd, TransactionAgent::myIdentity, outbuf, outcmd, put(), replymsg(), sockfd, state, STATE_ABORTED, STATE_ESTABLISHED, ApiInterface::taPtr, and ApiInterface::transactionPtr.
Referenced by cont(), continuePgCommitexplicit(), continuePgCommitimplicit(), continuePgFunc(), continuePgRollbackexplicit(), putAuthenticationOk(), putErrorResponse(), and rewritesocket().
bool Pg::command_autocommit |
Definition at line 466 of file Pg.h.
Referenced by continuePgFunc(), and executeStatement().
std::string Pg::inbuf |
bool Pg::isintransactionblock |
Definition at line 467 of file Pg.h.
Referenced by cont(), continuePgFunc(), and sqlrollbackimplicit().
std::string Pg::outbuf |
Definition at line 453 of file Pg.h.
Referenced by cont(), continuePgCommitexplicit(), continuePgRollbackexplicit(), continuePgRollbackimplicit(), replymsg(), and writesocket().
char Pg::outcmd |
Definition at line 451 of file Pg.h.
Referenced by cont(), putAuthenticationOk(), putCommandComplete(), putDataRows(), putErrorResponse(), putNoticeResponse(), putParameterStatus(), putRowDescription(), replymsg(), and writesocket().
std::string Pg::outmsg |
Definition at line 452 of file Pg.h.
Referenced by put(), and replymsg().
std::string Pg::procedureprefix |
Definition at line 461 of file Pg.h.
Referenced by continueLogin(), and executeStatement().
class Schema* Pg::schemaPtr |
Definition at line 456 of file Pg.h.
Referenced by cont(), continueLogin(), and executeStatement().
bool Pg::session_isautocommit |
Definition at line 464 of file Pg.h.
Referenced by continuePgFunc().
uint32_t Pg::size |
Definition at line 448 of file Pg.h.
Referenced by cont(), initcmd(), and putAuthenticationOk().
int Pg::sockfd |
Definition at line 445 of file Pg.h.
Referenced by closesocket(), cont(), initcmd(), Pg(), readsocket(), rewritesocket(), and writesocket().
boost::unordered_map<std::string, std::string> Pg::startupArgs |
Definition at line 459 of file Pg.h.
Referenced by cont(), and putAuthenticationOk().
states_e Pg::state |
Definition at line 444 of file Pg.h.
Referenced by closesocket(), cont(), continuePgCommitexplicit(), continuePgCommitimplicit(), continuePgFunc(), continuePgRollbackexplicit(), continuePgRollbackimplicit(), initcmd(), putAuthenticationOk(), sqlrollbackimplicit(), and writesocket().
int64_t Pg::userid |
Definition at line 455 of file Pg.h.
Referenced by continueLogin().