@@ -43,6 +43,7 @@ public function __construct(private string $host, private int $port, private str
4343 dict <string , string > $_query_attributes = dict [],
4444 ): Awaitable <AsyncMysqlQueryResult > {
4545 Logger :: log(Verbosity :: QUERIES , " SQLFake [verbose]: $query " );
46+ QueryContext :: $query = $query ;
4647
4748 $config = $this -> server -> config ;
4849 $strict_sql_before = QueryContext :: $strictSQLMode ;
@@ -62,11 +63,13 @@ public function __construct(private string $host, private int $port, private str
6263 try {
6364 list ($results , $rows_affected ) = SQLCommandProcessor :: execute($query , $this );
6465 } catch (\ Exception $e ) {
65- // this makes debugging a failing unit test easier, show the actual query that failed parsing along with the parser error
6666 QueryContext :: $strictSQLMode = $strict_sql_before ;
6767 QueryContext :: $strictSchemaMode = $strict_schema_before ;
68+ // Make debugging a failing unit test locally easier,
69+ // by showing the actual query that failed parsing along with the parser error
6870 $msg = $e -> getMessage();
6971 $type = \get_class ($e );
72+ Logger :: log(Verbosity :: QUIET , $e -> getFile(). ' ' . $e -> getLine());
7073 Logger :: log(Verbosity :: QUIET , " SQL Fake $type : $msg in SQL query: $query " );
7174 throw $e ;
7275 }
@@ -82,7 +85,10 @@ public function __construct(private string $host, private int $port, private str
8285 }
8386
8487 <<__Override >>
85- public function queryf (\HH \ FormatString <\HH \ SQLFormatter > $query , mixed ...$args ): Awaitable <AsyncMysqlQueryResult > {
88+ public function queryf (
89+ \HH \ FormatString <\HH \ SQLFormatter > $query ,
90+ mixed ...$args
91+ ): Awaitable <AsyncMysqlQueryResult > {
8692 invariant ($query is string , ' \\ HH\\ FormatString<_> is opaque, but we need it to be a string here.' );
8793 return $this -> query($this -> queryStringifier -> formatString($query , vec ($args )));
8894 }
0 commit comments