@@ -50,8 +50,8 @@ impl TpccTransaction for Delivery {
5050 let tuple = tx. query_one (
5151 & statements[ 0 ] ,
5252 & [
53- ( "? 1" , DataValue :: Int8 ( d_id as i8 ) ) ,
54- ( "? 2" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
53+ ( "$ 1" , DataValue :: Int8 ( d_id as i8 ) ) ,
54+ ( "$ 2" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
5555 ] ,
5656 ) ?;
5757 let no_o_id = tuple. values [ 0 ] . i32 ( ) . unwrap ( ) ;
@@ -63,59 +63,59 @@ impl TpccTransaction for Delivery {
6363 tx. execute_drain (
6464 & statements[ 1 ] ,
6565 & [
66- ( "? 1" , DataValue :: Int32 ( no_o_id) ) ,
67- ( "? 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
68- ( "? 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
66+ ( "$ 1" , DataValue :: Int32 ( no_o_id) ) ,
67+ ( "$ 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
68+ ( "$ 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
6969 ] ,
7070 ) ?;
7171 // "SELECT o_c_id FROM orders WHERE o_id = ? AND o_d_id = ? AND o_w_id = ?"
7272 let tuple = tx. query_one (
7373 & statements[ 2 ] ,
7474 & [
75- ( "? 1" , DataValue :: Int32 ( no_o_id) ) ,
76- ( "? 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
77- ( "? 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
75+ ( "$ 1" , DataValue :: Int32 ( no_o_id) ) ,
76+ ( "$ 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
77+ ( "$ 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
7878 ] ,
7979 ) ?;
8080 let c_id = tuple. values [ 0 ] . i32 ( ) . unwrap ( ) ;
8181 // "UPDATE orders SET o_carrier_id = ? WHERE o_id = ? AND o_d_id = ? AND o_w_id = ?"
8282 tx. execute_drain (
8383 & statements[ 3 ] ,
8484 & [
85- ( "? 1" , DataValue :: Int8 ( args. o_carrier_id as i8 ) ) ,
86- ( "? 2" , DataValue :: Int32 ( no_o_id) ) ,
87- ( "? 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
88- ( "? 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
85+ ( "$ 1" , DataValue :: Int8 ( args. o_carrier_id as i8 ) ) ,
86+ ( "$ 2" , DataValue :: Int32 ( no_o_id) ) ,
87+ ( "$ 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
88+ ( "$ 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
8989 ] ,
9090 ) ?;
9191 // "UPDATE order_line SET ol_delivery_d = ? WHERE ol_o_id = ? AND ol_d_id = ? AND ol_w_id = ?"
9292 tx. execute_drain (
9393 & statements[ 4 ] ,
9494 & [
95- ( "? 1" , DataValue :: from ( & now) ) ,
96- ( "? 2" , DataValue :: Int32 ( no_o_id) ) ,
97- ( "? 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
98- ( "? 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
95+ ( "$ 1" , DataValue :: from ( & now) ) ,
96+ ( "$ 2" , DataValue :: Int32 ( no_o_id) ) ,
97+ ( "$ 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
98+ ( "$ 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
9999 ] ,
100100 ) ?;
101101 // "SELECT SUM(ol_amount) FROM order_line WHERE ol_o_id = ? AND ol_d_id = ? AND ol_w_id = ?"
102102 let tuple = tx. query_one (
103103 & statements[ 5 ] ,
104104 & [
105- ( "? 1" , DataValue :: Int32 ( no_o_id) ) ,
106- ( "? 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
107- ( "? 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
105+ ( "$ 1" , DataValue :: Int32 ( no_o_id) ) ,
106+ ( "$ 2" , DataValue :: Int8 ( d_id as i8 ) ) ,
107+ ( "$ 3" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
108108 ] ,
109109 ) ?;
110110 let ol_total = tuple. values [ 0 ] . decimal ( ) . unwrap ( ) ;
111111 // "UPDATE customer SET c_balance = c_balance + ? , c_delivery_cnt = c_delivery_cnt + 1 WHERE c_id = ? AND c_d_id = ? AND c_w_id = ?"
112112 tx. execute_drain (
113113 & statements[ 6 ] ,
114114 & [
115- ( "? 1" , DataValue :: Decimal ( ol_total) ) ,
116- ( "? 2" , DataValue :: Int32 ( c_id) ) ,
117- ( "? 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
118- ( "? 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
115+ ( "$ 1" , DataValue :: Decimal ( ol_total) ) ,
116+ ( "$ 2" , DataValue :: Int32 ( c_id) ) ,
117+ ( "$ 3" , DataValue :: Int8 ( d_id as i8 ) ) ,
118+ ( "$ 4" , DataValue :: Int16 ( args. w_id as i16 ) ) ,
119119 ] ,
120120 ) ?;
121121 }
0 commit comments