| 1 | // https://dev.mysql.com/doc/dev/mysql-server/8.0.12/mysql__com_8h.html#a1d854e841086925be1883e4d7b4e8cad |
| 2 | // https://mariadb.com/kb/en/library/mariadb-connectorc-types-and-definitions/#server-status |
| 3 | bitflags::bitflags! { |
| 4 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
| 5 | pub struct Status: u16 { |
| 6 | // Is raised when a multi-statement transaction has been started, either explicitly, |
| 7 | // by means of BEGIN or COMMIT AND CHAIN, or implicitly, by the first |
| 8 | // transactional statement, when autocommit=off. |
| 9 | const SERVER_STATUS_IN_TRANS = 1; |
| 10 | |
| 11 | // Autocommit mode is set |
| 12 | const SERVER_STATUS_AUTOCOMMIT = 2; |
| 13 | |
| 14 | // Multi query - next query exists. |
| 15 | const SERVER_MORE_RESULTS_EXISTS = 8; |
| 16 | |
| 17 | const SERVER_QUERY_NO_GOOD_INDEX_USED = 16; |
| 18 | const SERVER_QUERY_NO_INDEX_USED = 32; |
| 19 | |
| 20 | // When using COM_STMT_FETCH, indicate that current cursor still has result |
| 21 | const SERVER_STATUS_CURSOR_EXISTS = 64; |
| 22 | |
| 23 | // When using COM_STMT_FETCH, indicate that current cursor has finished to send results |
| 24 | const SERVER_STATUS_LAST_ROW_SENT = 128; |
| 25 | |
| 26 | // Database has been dropped |
| 27 | const SERVER_STATUS_DB_DROPPED = (1 << 8); |
| 28 | |
| 29 | // Current escape mode is "no backslash escape" |
| 30 | const SERVER_STATUS_NO_BACKSLASH_ESCAPES = (1 << 9); |
| 31 | |
| 32 | // A DDL change did have an impact on an existing PREPARE (an automatic |
| 33 | // re-prepare has been executed) |
| 34 | const SERVER_STATUS_METADATA_CHANGED = (1 << 10); |
| 35 | |
| 36 | // Last statement took more than the time value specified |
| 37 | // in server variable long_query_time. |
| 38 | const SERVER_QUERY_WAS_SLOW = (1 << 11); |
| 39 | |
| 40 | // This result-set contain stored procedure output parameter. |
| 41 | const SERVER_PS_OUT_PARAMS = (1 << 12); |
| 42 | |
| 43 | // Current transaction is a read-only transaction. |
| 44 | const SERVER_STATUS_IN_TRANS_READONLY = (1 << 13); |
| 45 | |
| 46 | // This status flag, when on, implies that one of the state information has changed |
| 47 | // on the server because of the execution of the last statement. |
| 48 | const SERVER_SESSION_STATE_CHANGED = (1 << 14); |
| 49 | } |
| 50 | } |