@@ -79,14 +79,14 @@ async fn test_storage_sql_command(url: &str) -> Result<(), sqlx::Error> {
79
79
// execute queries - SQLite, prepared query
80
80
let _ = sqlx:: query ( insert_query1. as_str ( ) ) . execute ( & mut conn2) . await ?;
81
81
let _ = sqlx:: query ( insert_query2. as_str ( ) ) . execute ( & mut conn2) . await ?; // $ Alert[rust/cleartext-storage-database]
82
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . execute ( & mut conn2) . await ?;
83
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . execute ( & mut conn2) . await ?; // $ MISSING: Alert[rust/cleartext-storage-database]
82
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . bind ( id ) . execute ( & mut conn2) . await ?;
83
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . bind ( id ) . execute ( & mut conn2) . await ?; // $ MISSING: Alert[rust/cleartext-storage-database]
84
84
85
85
// execute queries - SQLite, prepared query variant
86
86
let _ = sqlx:: query ( insert_query1. as_str ( ) ) . fetch ( & mut conn2) ;
87
87
let _ = sqlx:: query ( insert_query2. as_str ( ) ) . fetch ( & mut conn2) ; // $ Alert[rust/cleartext-storage-database]
88
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . fetch ( & mut conn2) ;
89
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . fetch ( & mut conn2) ; // $ MISSING: Alert[rust/cleartext-storage-database]
88
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . bind ( id ) . fetch ( & mut conn2) ;
89
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . bind ( id ) . fetch ( & mut conn2) ; // $ MISSING: Alert[rust/cleartext-storage-database]
90
90
91
91
// connect through a PostgreSQL connection pool
92
92
let pool3 = sqlx:: postgres:: PgPool :: connect ( url) . await ?;
@@ -99,8 +99,8 @@ async fn test_storage_sql_command(url: &str) -> Result<(), sqlx::Error> {
99
99
// execute queries - PostgreSQL, prepared query
100
100
let _ = sqlx:: query ( insert_query1. as_str ( ) ) . execute ( & pool3) . await ?;
101
101
let _ = sqlx:: query ( insert_query2. as_str ( ) ) . execute ( & pool3) . await ?; // $ Alert[rust/cleartext-storage-database]
102
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . execute ( & pool3) . await ?;
103
- let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . execute ( & pool3) . await ?; // $ MISSING: Alert[rust/cleartext-storage-database]
102
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_harmless ( ) ) . bind ( id ) . execute ( & pool3) . await ?;
103
+ let _ = sqlx:: query ( prepared_query. as_str ( ) ) . bind ( get_social_security_number ( ) ) . bind ( id ) . execute ( & pool3) . await ?; // $ MISSING: Alert[rust/cleartext-storage-database]
104
104
105
105
Ok ( ( ) )
106
106
}
0 commit comments