136 lines
4.1 KiB
Plaintext
136 lines
4.1 KiB
Plaintext
$OpenBSD: patch-sqlplusint_connection_cc,v 1.3 2002/08/10 20:07:02 wilfried Exp $
|
|
--- sqlplusint/connection.cc.orig Sat May 19 18:44:48 2001
|
|
+++ sqlplusint/connection.cc Fri Aug 9 16:10:03 2002
|
|
@@ -10,11 +10,11 @@ Connection::Connection (const char *db,
|
|
if (real_connect (db, host, user, passwd,3306,0,60,NULL,0))
|
|
{
|
|
locked = false;
|
|
- Success = is_connected = true;
|
|
+ Success_ = is_connected = true;
|
|
}
|
|
else
|
|
{
|
|
- locked = false; Success = is_connected = false;
|
|
+ locked = false; Success_ = is_connected = false;
|
|
if (throw_exceptions) throw BadQuery(error());
|
|
}
|
|
}
|
|
@@ -29,11 +29,11 @@ Connection::Connection (const char *db,
|
|
if (real_connect (db, host, user, passwd, port, compress, connect_timeout,socket_name, client_flag))
|
|
{
|
|
locked = false;
|
|
- Success = is_connected = true;
|
|
+ Success_ = is_connected = true;
|
|
}
|
|
else
|
|
{
|
|
- locked = false; Success = is_connected = false;
|
|
+ locked = false; Success_ = is_connected = false;
|
|
if (throw_exceptions) throw BadQuery(error());
|
|
}
|
|
}
|
|
@@ -52,18 +52,18 @@ bool Connection::real_connect (cchar *db
|
|
if (mysql_real_connect(&mysql,host,user,passwd,db, port,socket_name,client_flag))
|
|
{
|
|
locked = false;
|
|
- Success = is_connected = true;
|
|
+ Success_ = is_connected = true;
|
|
}
|
|
else
|
|
{
|
|
- locked = false; Success = is_connected = false;
|
|
+ locked = false; Success_ = is_connected = false;
|
|
if (throw_exceptions) throw BadQuery(error());
|
|
}
|
|
// mysql.options.my_cnf_file=0;
|
|
- if (!Success) return Success;
|
|
+ if (!Success_) return Success_;
|
|
if (db && db[0]) // if db is not empty
|
|
- Success = select_db(db);
|
|
- return Success;
|
|
+ Success_ = select_db(db);
|
|
+ return Success_;
|
|
}
|
|
|
|
Connection::~Connection () {
|
|
@@ -95,17 +95,17 @@ bool Connection::connect (cchar *db, cch
|
|
|
|
if (mysql_real_connect(&mysql,host,user,passwd,db, 3306,NULL,0)) {
|
|
locked = false;
|
|
- Success = is_connected = true;
|
|
+ Success_ = is_connected = true;
|
|
} else {
|
|
locked = false;
|
|
if (throw_exceptions) throw BadQuery(error());
|
|
- Success = is_connected = false;
|
|
+ Success_ = is_connected = false;
|
|
}
|
|
// mysql.options.my_cnf_file=0;
|
|
- if (!Success) return Success;
|
|
+ if (!Success_) return Success_;
|
|
if (db && db[0]) // if db is not empty
|
|
- Success = select_db(db);
|
|
- return Success;
|
|
+ Success_ = select_db(db);
|
|
+ return Success_;
|
|
}
|
|
|
|
string Connection::info () {
|
|
@@ -117,44 +117,44 @@ string Connection::info () {
|
|
}
|
|
|
|
ResNSel Connection::execute(const string &str, bool throw_excptns) {
|
|
- Success = false;
|
|
+ Success_ = false;
|
|
if (lock())
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return ResNSel();
|
|
- Success = !mysql_query(&mysql, str.c_str());
|
|
+ Success_ = !mysql_query(&mysql, str.c_str());
|
|
unlock();
|
|
- if (!Success)
|
|
+ if (!Success_)
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return ResNSel();
|
|
return ResNSel(this);
|
|
}
|
|
|
|
bool Connection::exec(const string &str) {
|
|
- Success = !mysql_query(&mysql,str.c_str());
|
|
- if (!Success && throw_exceptions) throw BadQuery(error());
|
|
- return Success;
|
|
+ Success_ = !mysql_query(&mysql,str.c_str());
|
|
+ if (!Success_ && throw_exceptions) throw BadQuery(error());
|
|
+ return Success_;
|
|
}
|
|
|
|
Result Connection::store(const string &str, bool throw_excptns) {
|
|
- Success = false;
|
|
+ Success_ = false;
|
|
if (lock())
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return Result();
|
|
- Success = !mysql_query(&mysql, str.c_str());
|
|
+ Success_ = !mysql_query(&mysql, str.c_str());
|
|
unlock();
|
|
- if (!Success)
|
|
+ if (!Success_)
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return Result();
|
|
return Result(mysql_store_result(&mysql));
|
|
}
|
|
|
|
ResUse Connection::use(const string &str, bool throw_excptns) {
|
|
- Success = false;
|
|
+ Success_ = false;
|
|
if (lock())
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return ResUse();
|
|
- Success = !mysql_query(&mysql, str.c_str());
|
|
- if (!Success)
|
|
+ Success_ = !mysql_query(&mysql, str.c_str());
|
|
+ if (!Success_)
|
|
if (throw_excptns) throw BadQuery(error());
|
|
else return ResUse();
|
|
return ResUse(mysql_use_result(&mysql), this);
|