Skip to content

Commit

Permalink
Merge pull request #55 from mathias-baumann-sociomantic/conststr
Browse files Browse the repository at this point in the history
Replace string with const(char)[] for sql string
  • Loading branch information
Abscissa committed Feb 2, 2015
2 parents 2815be7 + ae79e32 commit 711d27e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/mysql/protocol/commands.d
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Command
{
package:
Connection _con;
string _sql;
const(char)[] _sql;
uint _hStmt;
ulong _insertID;
bool _rowsPending, _headersPending, _pendingBinary, _rebound;
Expand Down Expand Up @@ -409,7 +409,7 @@ public:
* Params: con = A Connection object to communicate with the server
* sql = SQL command string.
*/
this(Connection con, string sql)
this(Connection con, const(char)[] sql)
{
_sql = sql;
this(con);
Expand All @@ -418,7 +418,7 @@ public:
@property
{
/// Get the current SQL for the Command
string sql() pure const nothrow { return _sql; }
const(char)[] sql() pure const nothrow { return _sql; }

/**
* Set a new SQL command.
Expand All @@ -434,15 +434,15 @@ public:
*
* Params: sql = SQL command string.
*/
string sql(string sql)
const(char)[] sql(const(char)[] sql)
{
if (_hStmt)
{
purgeResult();
releaseStatement();
_con.resetPacket();
}
return _sql = sql;
return this._sql = sql;
}
}

Expand Down

0 comments on commit 711d27e

Please sign in to comment.