Skip to content

Commit 9d0be0b

Browse files
committed
Merge remote-tracking branch 'origin/wl14216-jdbc' into jdbc
2 parents d8ea5f2 + 112cde5 commit 9d0be0b

15 files changed

+1094
-166
lines changed

cppconn/statement.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ class Statement
9696
virtual void setQueryTimeout(unsigned int seconds) = 0;
9797

9898
virtual Statement * setResultSetType(sql::ResultSet::enum_type type) = 0;
99+
100+
virtual int setQueryAttrBigInt(const sql::SQLString &name, const sql::SQLString& value) = 0;
101+
virtual int setQueryAttrBoolean(const sql::SQLString &name, bool value) = 0;
102+
virtual int setQueryAttrDateTime(const sql::SQLString &name, const sql::SQLString& value) = 0;
103+
virtual int setQueryAttrDouble(const sql::SQLString &name, double value) = 0;
104+
virtual int setQueryAttrInt(const sql::SQLString &name, int32_t value) = 0;
105+
virtual int setQueryAttrUInt(const sql::SQLString &name, uint32_t value) = 0;
106+
virtual int setQueryAttrInt64(const sql::SQLString &name, int64_t value) = 0;
107+
virtual int setQueryAttrUInt64(const sql::SQLString &name, uint64_t value) = 0;
108+
virtual int setQueryAttrNull(const sql::SQLString &name) = 0;
109+
virtual int setQueryAttrString(const sql::SQLString &name, const sql::SQLString& value) = 0;
110+
111+
virtual void clearAttributes() = 0;
112+
99113
};
100114

101115
} /* namespace sql */

driver/mysql_prepared_statement.cpp

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class BlobIsNull : public boost::static_visitor<bool>
203203
};
204204

205205

206-
void resetBlobBind(MYSQL_BIND & param)
206+
void resetBlobBind(MYSQL_BIND & param)
207207
{
208208
delete [] static_cast<char *>(param.buffer);
209209

@@ -1280,6 +1280,134 @@ MySQL_Prepared_Statement::setResultSetType(sql::ResultSet::enum_type /* type */)
12801280
/* }}} */
12811281

12821282

1283+
/* {{{ MySQL_Prepared_Statement::setQueryAttrBigInt() -U- */
1284+
int
1285+
MySQL_Prepared_Statement::setQueryAttrBigInt(const sql::SQLString &name, const sql::SQLString& value)
1286+
{
1287+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrBigInt");
1288+
CPP_INFO_FMT("this=%p", this);
1289+
CPP_INFO_FMT("name=%s value=%s", name.c_str(), value.c_str());
1290+
return 0;
1291+
}
1292+
/* }}} */
1293+
1294+
1295+
/* {{{ MySQL_Prepared_Statement::setQueryAttrBoolean() -U- */
1296+
int
1297+
MySQL_Prepared_Statement::setQueryAttrBoolean(const sql::SQLString &name, bool value)
1298+
{
1299+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrBoolean");
1300+
CPP_INFO_FMT("this=%p", this);
1301+
CPP_INFO_FMT("name=%s value=%s", name.c_str(), value ? "true" : "false");
1302+
return 0;
1303+
}
1304+
/* }}} */
1305+
1306+
1307+
/* {{{ MySQL_Prepared_Statement::setQueryAttrDateTime() -U- */
1308+
int
1309+
MySQL_Prepared_Statement::setQueryAttrDateTime(const sql::SQLString &name, const sql::SQLString& value)
1310+
{
1311+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrDateTime");
1312+
CPP_INFO_FMT("this=%p", this);
1313+
CPP_INFO_FMT("name=%s value=%s", name.c_str(), value.c_str());
1314+
return 0;
1315+
}
1316+
/* }}} */
1317+
1318+
1319+
/* {{{ MySQL_Prepared_Statement::setQueryAttrDouble() -U- */
1320+
int
1321+
MySQL_Prepared_Statement::setQueryAttrDouble(const sql::SQLString &name, double value)
1322+
{
1323+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrDouble");
1324+
CPP_INFO_FMT("this=%p", this);
1325+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value);
1326+
return 0;
1327+
}
1328+
/* }}} */
1329+
1330+
1331+
/* {{{ MySQL_Prepared_Statement::setQueryAttrInt() -U- */
1332+
int
1333+
MySQL_Prepared_Statement::setQueryAttrInt(const sql::SQLString &name, int32_t value)
1334+
{
1335+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrInt");
1336+
CPP_INFO_FMT("this=%p", this);
1337+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value);
1338+
return 0;
1339+
}
1340+
/* }}} */
1341+
1342+
1343+
/* {{{ MySQL_Prepared_Statement::setQueryAttrUInt() -U- */
1344+
int
1345+
MySQL_Prepared_Statement::setQueryAttrUInt(const sql::SQLString &name, uint32_t value)
1346+
{
1347+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrUInt");
1348+
CPP_INFO_FMT("this=%p", this);
1349+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value);
1350+
return 0;
1351+
}
1352+
/* }}} */
1353+
1354+
1355+
/* {{{ MySQL_Prepared_Statement::setQueryAttrInt64() -U- */
1356+
int
1357+
MySQL_Prepared_Statement::setQueryAttrInt64(const sql::SQLString &name, int64_t value)
1358+
{
1359+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrInt64");
1360+
CPP_INFO_FMT("this=%p", this);
1361+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value);
1362+
return 0;
1363+
}
1364+
/* }}} */
1365+
1366+
1367+
/* {{{ MySQL_Prepared_Statement::setQueryAttrUInt64() -U- */
1368+
int
1369+
MySQL_Prepared_Statement::setQueryAttrUInt64(const sql::SQLString &name, uint64_t value)
1370+
{
1371+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrUInt64");
1372+
CPP_INFO_FMT("this=%p", this);
1373+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value);
1374+
return 0;
1375+
}
1376+
/* }}} */
1377+
1378+
1379+
/* {{{ MySQL_Prepared_Statement::setQueryAttrNull() -U- */
1380+
int
1381+
MySQL_Prepared_Statement::setQueryAttrNull(const sql::SQLString &name)
1382+
{
1383+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrNull");
1384+
CPP_INFO_FMT("this=%p", this);
1385+
CPP_INFO_FMT("name=%s", name.c_str());
1386+
return 0;
1387+
}
1388+
/* }}} */
1389+
1390+
1391+
/* {{{ MySQL_Prepared_Statement::setQueryAttrString() -U- */
1392+
int
1393+
MySQL_Prepared_Statement::setQueryAttrString(const sql::SQLString &name, const sql::SQLString& value)
1394+
{
1395+
CPP_ENTER("MySQL_Prepared_Statement::setQueryAttrString");
1396+
CPP_INFO_FMT("this=%p", this);
1397+
CPP_INFO_FMT("name=%s value=%f", name.c_str(), value.c_str());
1398+
return 0;
1399+
}
1400+
/* }}} */
1401+
1402+
1403+
/* {{{ MySQL_Prepared_Statement::clearAttributes() -U- */
1404+
void
1405+
MySQL_Prepared_Statement::clearAttributes()
1406+
{
1407+
}
1408+
/* }}} */
1409+
1410+
12831411
/* {{{ MySQL_Prepared_Statement::checkClosed() -I- */
12841412
void
12851413
MySQL_Prepared_Statement::checkClosed()

driver/mysql_prepared_statement.h

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -98,86 +98,99 @@ class MySQL_Prepared_Statement : public sql::PreparedStatement
9898
boost::shared_ptr< MySQL_DebugLogger > & log);
9999
virtual ~MySQL_Prepared_Statement();
100100

101-
sql::Connection *getConnection();
101+
sql::Connection *getConnection() override;
102102

103-
void cancel();
103+
void cancel() override;
104104

105-
void clearParameters();
105+
void clearParameters() override;
106106

107-
void clearWarnings();
107+
void clearWarnings() override;
108108

109-
void close();
109+
void close() override;
110110

111-
bool execute();
112-
bool execute(const sql::SQLString& sql);
111+
bool execute() override;
112+
bool execute(const sql::SQLString& sql) override;
113113

114-
sql::ResultSet *executeQuery();
115-
sql::ResultSet *executeQuery(const sql::SQLString& sql);
114+
sql::ResultSet *executeQuery() override;
115+
sql::ResultSet *executeQuery(const sql::SQLString& sql) override;
116116

117-
int executeUpdate();
118-
int executeUpdate(const sql::SQLString& sql);
117+
int executeUpdate() override;
118+
int executeUpdate(const sql::SQLString& sql) override;
119119

120-
size_t getFetchSize();
120+
size_t getFetchSize() override;
121121

122-
unsigned int getMaxFieldSize();
122+
unsigned int getMaxFieldSize() override;
123123

124-
sql::ResultSetMetaData * getMetaData();
124+
sql::ResultSetMetaData * getMetaData() override;
125125

126-
uint64_t getMaxRows();
126+
uint64_t getMaxRows() override;
127127

128-
bool getMoreResults();
128+
bool getMoreResults() override;
129129

130-
sql::ParameterMetaData * getParameterMetaData();
130+
sql::ParameterMetaData * getParameterMetaData() override;
131131

132-
unsigned int getQueryTimeout();
132+
unsigned int getQueryTimeout() override;
133133

134-
sql::ResultSet * getResultSet();
134+
sql::ResultSet * getResultSet() override;
135135

136-
sql::ResultSet::enum_type getResultSetType();
136+
sql::ResultSet::enum_type getResultSetType() override;
137137

138-
uint64_t getUpdateCount();
138+
uint64_t getUpdateCount() override;
139139

140-
const SQLWarning * getWarnings();/* should return different type */
140+
const SQLWarning * getWarnings() override;/* should return different type */
141141

142142
Statement * setBuffered();
143143

144-
void setBlob(unsigned int parameterIndex, std::istream * blob);
144+
void setBlob(unsigned int parameterIndex, std::istream * blob) override;
145145

146-
void setBoolean(unsigned int parameterIndex, bool value);
146+
void setBoolean(unsigned int parameterIndex, bool value) override;
147147

148-
void setBigInt(unsigned int parameterIndex, const sql::SQLString& value);
148+
void setBigInt(unsigned int parameterIndex, const sql::SQLString& value) override;
149149

150-
void setCursorName(const sql::SQLString &name);
150+
void setCursorName(const sql::SQLString &name) override;
151151

152-
void setDateTime(unsigned int parameterIndex, const sql::SQLString& value);
152+
void setDateTime(unsigned int parameterIndex, const sql::SQLString& value) override;
153153

154-
void setDouble(unsigned int parameterIndex, double value);
154+
void setDouble(unsigned int parameterIndex, double value) override;
155155

156-
void setEscapeProcessing(bool enable);
156+
void setEscapeProcessing(bool enable) override;
157157

158-
void setFetchSize(size_t rows);
158+
void setFetchSize(size_t rows) override;
159159

160-
void setInt(unsigned int parameterIndex, int32_t value);
160+
void setInt(unsigned int parameterIndex, int32_t value) override;
161161

162-
void setUInt(unsigned int parameterIndex, uint32_t value);
162+
void setUInt(unsigned int parameterIndex, uint32_t value) override;
163163

164-
void setInt64(unsigned int parameterIndex, int64_t value);
164+
void setInt64(unsigned int parameterIndex, int64_t value) override;
165165

166-
void setUInt64(unsigned int parameterIndex, uint64_t value);
166+
void setUInt64(unsigned int parameterIndex, uint64_t value) override;
167167

168-
void setMaxFieldSize(unsigned int max);
168+
void setMaxFieldSize(unsigned int max) override;
169169

170-
void setMaxRows(unsigned int max);
170+
void setMaxRows(unsigned int max) override;
171171

172-
void setNull(unsigned int parameterIndex, int sqlType);
172+
void setNull(unsigned int parameterIndex, int sqlType) override;
173173

174174
void setResultSetConcurrency(int concurrencyFlag);
175175

176-
void setString(unsigned int parameterIndex, const sql::SQLString& value);
176+
void setString(unsigned int parameterIndex, const sql::SQLString& value) override;
177177

178-
void setQueryTimeout(unsigned int seconds);
178+
void setQueryTimeout(unsigned int seconds) override;
179179

180-
sql::PreparedStatement * setResultSetType(sql::ResultSet::enum_type type);
180+
sql::PreparedStatement * setResultSetType(sql::ResultSet::enum_type type) override;
181+
182+
int setQueryAttrBigInt(const sql::SQLString &name, const sql::SQLString& value) override;
183+
int setQueryAttrBoolean(const sql::SQLString &name, bool value) override;
184+
int setQueryAttrDateTime(const sql::SQLString &name, const sql::SQLString& value) override;
185+
int setQueryAttrDouble(const sql::SQLString &name, double value) override;
186+
int setQueryAttrInt(const sql::SQLString &name, int32_t value) override;
187+
int setQueryAttrUInt(const sql::SQLString &name, uint32_t value) override;
188+
int setQueryAttrInt64(const sql::SQLString &name, int64_t value) override;
189+
int setQueryAttrUInt64(const sql::SQLString &name, uint64_t value) override;
190+
int setQueryAttrNull(const sql::SQLString &name) override;
191+
int setQueryAttrString(const sql::SQLString &name, const sql::SQLString& value) override;
192+
193+
void clearAttributes() override;
181194

182195
private:
183196
/* Prevent use of these */

0 commit comments

Comments
 (0)