@@ -126,6 +126,7 @@ func (h *handler) ComQuery(c *mysql.Conn, query string, callback func(*sqltypes.
126
126
slog .String ("addr" , c .GetRawConn ().LocalAddr ().String ()),
127
127
slog .Int ("mysql_id" , int (c .ConnectionID )),
128
128
slog .String ("query" , query ),
129
+ slog .Bool ("olap" , data .IsOLAP ()),
129
130
)
130
131
131
132
if data .IsOLAP () {
@@ -157,6 +158,15 @@ func (h *handler) ComQuery(c *mysql.Conn, query string, callback func(*sqltypes.
157
158
func (h * handler ) ComPrepare (c * mysql.Conn , query string , bindVars map [string ]* vitessquerypb.BindVariable ) ([]* vitessquerypb.Field , error ) {
158
159
data := h .clientData (c )
159
160
161
+ defer h .logger .LogAttrs (
162
+ context .Background (),
163
+ slog .LevelDebug ,
164
+ "prepare" ,
165
+ slog .String ("addr" , c .GetRawConn ().LocalAddr ().String ()),
166
+ slog .Int ("mysql_id" , int (c .ConnectionID )),
167
+ slog .String ("query" , query ),
168
+ )
169
+
160
170
resp , err := h .client .Prepare (context .Background (), connect .NewRequest (& psdbpb.PrepareRequest {
161
171
Session : data .Session ,
162
172
Query : query ,
@@ -180,6 +190,16 @@ func (h *handler) ComPrepare(c *mysql.Conn, query string, bindVars map[string]*v
180
190
func (h * handler ) ComStmtExecute (c * mysql.Conn , prepare * mysql.PrepareData , callback func (* sqltypes.Result ) error ) error {
181
191
data := h .clientData (c )
182
192
193
+ defer h .logger .LogAttrs (
194
+ context .Background (),
195
+ slog .LevelDebug ,
196
+ "stmt_execute" ,
197
+ slog .String ("addr" , c .GetRawConn ().LocalAddr ().String ()),
198
+ slog .Int ("mysql_id" , int (c .ConnectionID )),
199
+ slog .String ("query" , prepare .PrepareStmt ),
200
+ slog .Bool ("olap" , data .IsOLAP ()),
201
+ )
202
+
183
203
if data .IsOLAP () {
184
204
return h .streamExecute (c , data , prepare .PrepareStmt , castBindVars (prepare .BindVars ), callback )
185
205
}
0 commit comments