arpitjain099 commented on PR #68454:
URL: https://github.com/apache/doris/pull/68454#issuecomment-5811482761

   Thanks, pushed a follow-up.
   
   On the tests: the escape matrix now covers the one-hex-digit forms (`%z1`, 
`%1z`, `a%1gb`), the sign and space cases a stream parse is most willing to 
swallow (`%+1`, `%-1`, `% 1`, `%1 `), a `%` at and one character from the end, 
both digit cases, `%00`, multi byte UTF-8, and an encode/decode round trip over 
every byte value from 1 to 255.
   
   The review is right that validating the path name was not enough, and the 
reason turned out to sit outside this file. `init_from_evhttp` parses the query 
string into `_params`, then `_find_handler` routes and `PathTrie::put` adds the 
captures with `map::insert`, which does not overwrite. So the query string won:
   
   ```
   PUT /api/realdb/tbl/_stream_load?db=otherdb  ->  param("db") = otherdb
   ```
   
   `put` now assigns, and the same request gives `realdb`. There is a case for 
it in `path_trie_test`.
   
   I also clear `ctx->db` and `ctx->table` when the decode fails. `url_decode` 
clears its output and then appends until it gives up, so the log line and the 
failed load record were both showing a truncated name.
   
   One point in the review I do not think holds: that FE folding and BE runtime 
still disagree on signed escape forms such as `%+1`. I ran both over the same 
19 inputs and they agree on all of them now, `%+1` included. Before this change 
the BE decoded it to `\x01` while `URLDecoder` rejected it, which is the 
divergence the patch removes.
   
   I cannot run the BE suite on this machine, so CI is the real check on all of 
the above. Separately, `path_trie_test.cpp` does not compile on its own for me 
because `SplitTest` calls the private `split`; that looks unrelated but might 
be worth a glance.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to