File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
frameworks/Rust/hyperlane/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ pub async fn get_update_data(limit: Queries) -> (String, Vec<QueryRow>) {
135135 let mut query: String = format ! ( "UPDATE {} SET randomNumber = CASE id " , TABLE_NAME_WORLD ) ;
136136 let mut id_list: Vec < i32 > = Vec :: with_capacity ( limit as usize ) ;
137137 let mut value_list: String = String :: new ( ) ;
138- let mut id_in_clause: String = String :: new ( ) ;
138+ let mut id_in_clause: String = String :: from ( "?::INTEGER" ) ;
139139 for ( i, row) in rows. iter ( ) . enumerate ( ) {
140140 let new_random_number: i32 = rand:: rng ( ) . random_range ( 1 ..RANDOM_MAX ) ;
141141 let id: i32 = row. id ;
@@ -145,13 +145,12 @@ pub async fn get_update_data(limit: Queries) -> (String, Vec<QueryRow>) {
145145 id, new_random_number
146146 ) ) ;
147147 if i > 0 {
148- id_in_clause. push_str ( "?::INTEGER, " ) ;
148+ id_in_clause. push_str ( ", ?::INTEGER" ) ;
149149 }
150- id_in_clause. push_str ( & id. to_string ( ) ) ;
151150 query_res_list. push ( QueryRow :: new ( id, new_random_number) ) ;
152151 }
153152 query. push_str ( & value_list) ;
154- query. push_str ( & format ! ( "END WHERE id IN ({}?::INTEGER )" , id_in_clause) ) ;
153+ query. push_str ( & format ! ( "END WHERE id IN ({})" , id_in_clause) ) ;
155154 ( query, query_res_list)
156155}
157156
You can’t perform that action at this time.
0 commit comments