@@ -4,14 +4,13 @@ extern crate msql_srv;
44extern crate mysql_async;
55extern crate mysql_common as myc;
66extern crate nom;
7- extern crate tokio_core ;
7+ extern crate tokio ;
88
99use futures:: { Future , IntoFuture } ;
1010use mysql_async:: prelude:: * ;
1111use std:: io;
1212use std:: net;
1313use std:: thread;
14- use tokio_core:: reactor:: Core ;
1514
1615use msql_srv:: {
1716 Column , ErrorKind , MysqlIntermediary , MysqlShim , ParamParser , QueryResultWriter ,
9392
9493 fn test < C , F > ( self , c : C )
9594 where
96- F : IntoFuture < Item = ( ) , Error = mysql_async:: errors :: Error > ,
95+ F : IntoFuture < Item = ( ) , Error = mysql_async:: error :: Error > ,
9796 C : FnOnce ( mysql_async:: Conn ) -> F ,
9897 {
9998 let listener = net:: TcpListener :: bind ( "127.0.0.1:0" ) . unwrap ( ) ;
@@ -103,15 +102,11 @@ where
103102 MysqlIntermediary :: run_on_tcp ( self , s)
104103 } ) ;
105104
106- let mut core = Core :: new ( ) . unwrap ( ) ;
107- let handle = core. handle ( ) ;
108- let db = core
109- . run ( mysql_async:: Conn :: new (
110- & format ! ( "mysql://127.0.0.1:{}" , port) ,
111- & handle,
112- ) )
113- . unwrap ( ) ;
114- core. run ( c ( db) . into_future ( ) ) . unwrap ( ) ;
105+ tokio:: runtime:: current_thread:: block_on_all (
106+ mysql_async:: Conn :: new ( format ! ( "mysql://127.0.0.1:{}" , port) ) . and_then ( |conn| c ( conn) ) ,
107+ )
108+ . unwrap ( ) ;
109+
115110 jh. join ( ) . unwrap ( ) . unwrap ( ) ;
116111 }
117112}
@@ -222,10 +217,11 @@ fn error_response() {
222217 db. query ( "SELECT a, b FROM foo" ) . then ( |r| {
223218 match r {
224219 Ok ( _) => assert ! ( false ) ,
225- Err ( mysql_async:: errors:: Error (
226- mysql_async:: errors:: ErrorKind :: Server ( ref state, code, ref msg) ,
227- _,
228- ) ) => {
220+ Err ( mysql_async:: error:: Error :: Server ( mysql_async:: error:: ServerError {
221+ code,
222+ message : ref msg,
223+ ref state,
224+ } ) ) => {
229225 assert_eq ! (
230226 state,
231227 & String :: from_utf8( err. 0 . sqlstate( ) . to_vec( ) ) . unwrap( )
0 commit comments