@@ -135,6 +135,7 @@ class TYPE(IntEnum):
135
135
Statistics = 5
136
136
Continued = 6
137
137
InitDB = 7
138
+ FieldList = 8
138
139
139
140
# The cPanel users associated with databases
140
141
# Used to represent values in COL.User
@@ -185,10 +186,14 @@ def getType(string):
185
186
elif string == "Statistics" :
186
187
return TYPE .Statistics .value
187
188
188
- elif string == "InitDB " :
189
+ elif string == "Init DB " :
189
190
return TYPE .InitDB .value
190
191
192
+ elif string == "Field List" :
193
+ return TYPE .FieldList .value
194
+
191
195
else :
196
+ print (string )
192
197
print ("Unknown type for line" )
193
198
lock .exit ()
194
199
@@ -316,7 +321,9 @@ def main():
316
321
is_type = re .compile ("^Query|^Connect|^Quit" )
317
322
statistics = re .compile ("^Statistics" )
318
323
init = re .compile ("^Init" )
319
- db = re .compile ("DB" )
324
+ db = re .compile ("^DB" )
325
+ field = re .compile ("^Field" )
326
+ list = re .compile ("^List" )
320
327
321
328
# Information from sql log now stored in array
322
329
# Begin processing array information
@@ -378,13 +385,32 @@ def main():
378
385
379
386
if init .match (split [1 ]):
380
387
# Insert the type to the array
381
- sqllog [x ].insert (COL .Type .value , getType (split [1 ] + split [2 ]))
388
+ sqllog [x ].insert (COL .Type .value , getType (split [1 ] + " " + split [2 ]))
389
+ # Insert the Query Number into the array
390
+ sqllog [x ].insert (COL .QueryNo .value , split [0 ])
391
+
392
+ else :
393
+ # Insert the type to the array
394
+ sqllog [x ].insert (COL .Type .value , getType (split [3 ]) + " " + split [4 ])
395
+ # Insert the Query Number into the array
396
+ sqllog [x ].insert (COL .QueryNo .value , split [2 ])
397
+
398
+ # Insert the index of this query to the array
399
+ sqllog [x ].insert (COL .StartIndex .value , x )
400
+
401
+ # Field List Command
402
+ # Check to see if this is a 'Field List' command if it is none of the above
403
+ elif (is_number .match (split [0 ]) and field .match (split [1 ]) and list .match (split [2 ])) or (is_number .match (split [0 ]) and is_time .match (split [1 ]) and is_number .match (split [2 ]) and field .match (split [3 ]) and list .match (split [4 ])):
404
+
405
+ if field .match (split [1 ]):
406
+ # Insert the type to the array
407
+ sqllog [x ].insert (COL .Type .value , getType (split [1 ] + " " + split [2 ]))
382
408
# Insert the Query Number into the array
383
409
sqllog [x ].insert (COL .QueryNo .value , split [0 ])
384
410
385
411
else :
386
412
# Insert the type to the array
387
- sqllog [x ].insert (COL .Type .value , getType (split [3 ]) + split [4 ])
413
+ sqllog [x ].insert (COL .Type .value , getType (split [3 ]) + " " + split [4 ])
388
414
# Insert the Query Number into the array
389
415
sqllog [x ].insert (COL .QueryNo .value , split [2 ])
390
416
0 commit comments