@@ -17,9 +17,9 @@ const QUERY_SHOW_PROCESS: &str = "SELECT state,query FROM pg_stat_activity";
1717lazy_static ! {
1818 static ref NORMALIZE_PATTERNS : Vec <NormalizePattern <' static >> = vec![
1919 NormalizePattern :: new( Regex :: new( r" +" ) . expect( "fail regex compile: +" ) , " " ) ,
20- NormalizePattern :: new( Regex :: new( r# "[+-]{0,1}\b\d+\b"# ) . expect( "fail regex compile: digit" ) , "N" ) ,
20+ NormalizePattern :: new( Regex :: new( r"[+-]{0,1}\b\d+\b" ) . expect( "fail regex compile: digit" ) , "N" ) ,
2121 NormalizePattern :: new( Regex :: new( r"\b0x[0-9A-Fa-f]+\b" ) . expect( "fail regex compile: hex" ) , "0xN" ) ,
22- NormalizePattern :: new( Regex :: new( r# "(\\')"# ) . expect( "fail regex compile: single quote" ) , "" ) ,
22+ NormalizePattern :: new( Regex :: new( r"(\\')" ) . expect( "fail regex compile: single quote" ) , "" ) ,
2323 NormalizePattern :: new( Regex :: new( r#"(\\")"# ) . expect( "fail regex compile: double quote" ) , "" ) ,
2424 NormalizePattern :: new( Regex :: new( r"'[^']+'" ) . expect( "fail regex compile: string1" ) , "S" ) ,
2525 NormalizePattern :: new( Regex :: new( r#""[^"]+""# ) . expect( "fail regex compile: string2" ) , "S" ) ,
@@ -332,6 +332,7 @@ mod tests {
332332 fn test_normalize ( ) {
333333 let data = vec ! [
334334 ( "IN ('a', 'b', 'c')" , "IN (S, S, S)" ) ,
335+ ( r#"IN ("a", "b", "1", 2)"# , "IN (S, S, S, N)" ) ,
335336 ( "IN ('a', 'b', 'c', 'd', 'e')" , "IN (...S)" ) ,
336337 ( "IN (1, 2, 3)" , "IN (N, N, N)" ) ,
337338 ( "IN (0x1, 2, 3)" , "IN (0xN, N, N)" ) ,
0 commit comments