mysql:656
From: <takeshi@xxxxxxxxxx>
Date: Thu, 28 Jan 1999 19:44:02 +0900
Subject: [mysql 00656] mysql_reload
--- mysql.c.orig Sun Jan 24 15:04:28 1999 +++ mysql.c Thu Jan 28 19:38:16 1999 @@ -256,6 +256,7 @@ return TRUE; } +#if MYSQL_VERSION_ID < 32100 /* reload() */ static VALUE reload(VALUE obj) { @@ -264,6 +265,17 @@ mysql_raise(m); return TRUE; } +#endif +#if MYSQL_VERSION_ID >= 32100 +/* refresh() */ +static VALUE refresh(VALUE obj, VALUE a) +{ + MYSQL* m = GetHandler(obj); + if (mysql_refresh(m, a) != 0) + mysql_raise(m); + return TRUE; +} +#endif /* select_db(db) */ static VALUE select_db(VALUE obj, VALUE db) @@ -623,7 +635,12 @@ rb_define_method(cMysql, "list_tables", list_tables, -1); rb_define_method(cMysql, "ping", ping, 0); rb_define_method(cMysql, "query", query, 1); +#if MYSQL_VERSION_ID < 32100 rb_define_method(cMysql, "reload", reload, 0); +#endif +#if MYSQL_VERSION_ID >= 32100 + rb_define_method(cMysql, "refresh", refresh, 1); +#endif rb_define_method(cMysql, "select_db", select_db, 1); rb_define_method(cMysql, "shutdown", my_shutdown, 0); rb_define_method(cMysql, "stat", my_stat, 0);