iproto: factor out sql request processing to box_process_sql
We are planning to add access checks for EXECUTE and PREPARE requests. (Currently, everyone, even guest, may execute these requests.) Checking access in tx_process_sql(), which is defined in IPROTO code, would violate encapsulation and look inconsistent with other request handlers. Let's move the code that actually processes an SQL request to the new function box_process_sql() taking sql_request and returning the result in a port object. To unify handling of all SQL requests in box_process_sql(), we add a new format for port_sql - UNPREPARE. The format works only for dumping port content to MsgPack buffer - it encodes an empty map then. This way, we don't need to return the is_unprepare flag from box_process_sql(). Needed for #8803 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
Showing
- src/box/execute.c 53 additions, 0 deletionssrc/box/execute.c
- src/box/execute.h 17 additions, 0 deletionssrc/box/execute.h
- src/box/iproto.cc 2 additions, 61 deletionssrc/box/iproto.cc
- src/box/sql/port.c 10 additions, 0 deletionssrc/box/sql/port.c
- src/box/sql/port.h 1 addition, 0 deletionssrc/box/sql/port.h
- src/box/xrow.c 2 additions, 0 deletionssrc/box/xrow.c
- src/box/xrow.h 2 additions, 0 deletionssrc/box/xrow.h
- test/fuzz/xrow_decode_sql_fuzzer.c 1 addition, 0 deletionstest/fuzz/xrow_decode_sql_fuzzer.c
Loading
Please register or sign in to comment