TODO: error messages? */
| 801 | |
| 802 | /* TODO: error messages? */ |
| 803 | void handle_newsql(cdb2_hndl_tp *db, cson_value *val) { |
| 804 | const char *sql = get_strprop(val, "sql"); |
| 805 | const char *fingerprint = get_strprop(val, "fingerprint"); |
| 806 | |
| 807 | if (sql == nullptr || fingerprint == nullptr) |
| 808 | return; |
| 809 | |
| 810 | /* If we already know this fingerprint, ignore it. |
| 811 | Checking if SQL matches is useless since diffent sql |
| 812 | statements can have identical fingerprints (eg: 'select 1' |
| 813 | and 'select 2'. Fingerprints are md5 hashes of the parse |
| 814 | tree. We can rely on them being unique for different |
| 815 | statement types, unless the user is malicious and extremely |
| 816 | clever, in which case we punish them with bad logging. |
| 817 | */ |
| 818 | if (sqltrack.find(fingerprint) != sqltrack.end()) |
| 819 | return; |
| 820 | |
| 821 | add_fingerprint(std::string(fingerprint), std::string(sql)); |
| 822 | } |
| 823 | |
| 824 | |
| 825 | void handle_txn(cdb2_hndl_tp *db, cson_value *val) { |
nothing calls this directly
no test coverage detected