659
659
uint32_t file_id; /**< File ID for LOAD DATA INFILE */
660
660
/* @note the following three members should likely move to Client */
661
661
uint32_t max_client_packet_length; /**< Maximum number of bytes a client can send in a single packet */
664
boost::posix_time::ptime _epoch;
665
boost::posix_time::ptime _start_timer;
666
boost::posix_time::ptime _end_timer;
662
670
time_t start_time;
663
671
time_t user_time;
664
uint64_t thr_create_utime; /**< track down slow pthread_create */
665
672
uint64_t start_utime;
666
673
uint64_t utime_after_lock;
1240
1248
const char* enter_cond(boost::condition_variable_any &cond, boost::mutex &mutex, const char* msg);
1241
1249
void exit_cond(const char* old_msg);
1243
inline time_t query_start() { return start_time; }
1244
inline void set_time()
1246
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1247
boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1248
start_utime= utime_after_lock= (mytime-epoch).total_microseconds();
1251
time_t query_start()
1258
_end_timer= _start_timer= boost::posix_time::microsec_clock::universal_time();
1259
start_utime= utime_after_lock= (_start_timer - _epoch).total_microseconds();
1253
1264
connect_microseconds= start_utime;
1256
start_time= (mytime-epoch).total_seconds();
1268
start_time= (_start_timer - _epoch).total_seconds();
1258
inline void set_current_time() { start_time= time(NULL); }
1259
inline void set_time(time_t t)
1272
void set_time(time_t t)
1261
1274
start_time= user_time= t;
1262
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1263
boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1264
uint64_t t_mark= (mytime-epoch).total_microseconds();
1275
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::universal_time());
1276
uint64_t t_mark= (mytime - _epoch).total_microseconds();
1266
1278
start_utime= utime_after_lock= t_mark;
1268
void set_time_after_lock() {
1269
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1270
boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1271
utime_after_lock= (mytime-epoch).total_microseconds();
1281
void set_time_after_lock()
1283
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::universal_time());
1284
utime_after_lock= (mytime - _epoch).total_microseconds();
1287
void set_end_timer()
1289
_end_timer= boost::posix_time::microsec_clock::universal_time();
1290
status_var.execution_time_nsec+=(_end_timer - _start_timer).total_microseconds();
1274
1294
* Returns the current micro-timestamp
1276
inline uint64_t getCurrentTimestamp()
1296
uint64_t getCurrentTimestamp(bool actual= true)
1278
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1279
boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1280
uint64_t t_mark= (mytime-epoch).total_microseconds();
1302
boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::universal_time());
1303
t_mark= (mytime - _epoch).total_microseconds();
1307
t_mark= (_end_timer - _epoch).total_microseconds();
1284
inline uint64_t found_rows(void)
1313
uint64_t found_rows(void)
1286
1315
return limit_found_rows;
1288
1318
/** Returns whether the session is currently inside a transaction */
1289
inline bool inTransaction()
1319
bool inTransaction()
1291
1321
return server_status & SERVER_STATUS_IN_TRANS;
1293
1324
LEX_STRING *make_lex_string(LEX_STRING *lex_str,
1294
1325
const char* str, uint32_t length,
1295
1326
bool allocate_lex_string);
1296
1328
LEX_STRING *make_lex_string(LEX_STRING *lex_str,
1297
1329
const std::string &str,
1298
1330
bool allocate_lex_string);
1300
1332
int send_explain_fields(select_result *result);
1302
1335
Clear the current error, if any.
1303
1336
We do not clear is_fatal_error or is_fatal_sub_stmt_error since we