1202 bool do_command(THD *thd) 1203 { 1267 packet_length= my_net_read_packet(net, 1); 1292 if (packet_length == packet_error) 1330 { 1331 return_value= TRUE; 1332 goto out; 1333 } 1339 1340 packet= (char*) net->read_pos; 1357 1359 command= fetch_command(thd, packet); 1391 return_value= dispatch_command(command, thd, 1392 packet+1, packet_length-1, FALSE, FALSE); 1426 out: 1431 return return_value; 1432 }
1685 switch (command) { 1701 case COM_REGISTER_SLAVE: 1717 case COM_CHANGE_USER: 1782 case COM_STMT_BULK_EXECUTE: 1787 case COM_STMT_EXECUTE: 1792 case COM_STMT_FETCH: 1797 case COM_STMT_SEND_LONG_DATA: 1802 case COM_STMT_PREPARE: 1807 case COM_STMT_CLOSE: 1817 case COM_QUERY: 2063 case COM_QUIT: 2074 case COM_BINLOG_DUMP: 2106 case COM_REFRESH: 2159 case COM_SHUTDOWN: 2230 case COM_PING: 2272 case COM_DEBUG: 2368 }
7991 void mysql_parse(THD *thd, char *rawbuf, uint length, 7995 { 8016 lex_start(thd); 8017 thd->reset_for_next_command(); 8025 if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0) 8026 { 8029 bool err= parse_sql(thd, parser_state, NULL, true); 8031 if (!err) 8076 error= mysql_execute_command(thd); 8081 else 8091 query_cache_abort(thd, &thd->query_cache_tls); 8098 thd->end_statement(); 8099 thd->cleanup_after_query(); 8101 } 8102 else 8110 thd->update_stats(); 8119 }
value= expr->val_int(); // or val_str(), val_real(), …
WHERE t2.f2 = t1.f1 AND t1.f1 = 7
WHERE t1.f1 = 7 AND t2.f2 = 7
WHERE NOT t1.f1 < 7
WHERE t1.f1 >= 7
CREATE TABLE ( ... INDEX (a,b) ... ); SELECT ... WHERE a IN (1,2) AND b IN (3,4) OR a=7 AND b BETWEEN 3 AND 8 OR a > 9 AND b < 5;
class select_result; ├─class select_send; ├─class select_export; ├┬class select_insert; │└──class select_create; ├─class multi_update; └─class multi_delete;
SELECT a,b,c FROM t1 ORDER BY a LIMIT 10