Thomas Markwalder
be964a2b42
[3780] MySQL and Postgres lease managers now exit on fatal error detection
...
src/lib/dhcpsrv/dhcpsrv_messages.mes
added messages DHCPSRV_MYSQL_FATAL_ERROR, DHCPSRV_PGSQL_FATAL_ERROR
src/lib/dhcpsrv/mysql_lease_mgr.cc
added MySQL client error code include
MySqlLeaseMgr::checkError() - method is no longer inlined in
the header. Expanded to detect unrecoverable errors, log
them and call exit().
src/lib/dhcpsrv/mysql_lease_mgr.h
Removed inline implemenation of MySqlLeaseMgr::checkError(),
and expanded commentary
src/lib/dhcpsrv/pgsql_lease_mgr.cc
PgSqlLeaseMgr::addLeaseCommon() - now uses checkStatementError()
PgSqlLeaseMgr::checkStatementError() - Expanded to detect
unrecoverable errors, log them and call exit().
src/lib/dhcpsrv/pgsql_lease_mgr.h
Expanded commentary for PgSqlLeaseMgr::checkStatementError()
2015-10-23 16:41:27 -04:00
Marcin Siodelski
640d3538c0
[3968] Added ASC sorting for indexes by expiration.
2015-10-15 21:48:01 +02:00
Tomek Mrugalski
884d8bb4a5
[master] Merge branch 'trac3681_rebase' (Common MySQL Connection class)
...
Conflicts:
src/lib/dhcpsrv/lease_mgr.h
src/lib/dhcpsrv/memfile_lease_mgr.cc
src/lib/dhcpsrv/mysql_lease_mgr.cc
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/schema_mysql_copy.h
2015-10-09 23:28:19 +02:00
Marcin Siodelski
069cf5f5f8
[3966] Addressed review comments.
2015-09-08 19:17:32 +02:00
Marcin Siodelski
04621a507a
[3966] Added missing logging trces to MySQL and Memfile.
2015-09-07 14:24:57 +02:00
Marcin Siodelski
f127bed4fb
[3966] Implemented deletion of the reclaimed leases in MySQL.
2015-09-07 13:58:22 +02:00
Marcin Siodelski
54a90126ec
[3966] Implemented methods to retrieve expired leases in MySQL.
2015-09-07 13:29:17 +02:00
Marcin Siodelski
d337f113cb
[3966] Updated MySQL lease manager to include state column in queries.
2015-09-07 10:47:30 +02:00
Marcin Siodelski
31c483f123
[3965] deleteExpiredReclaimed returns number of deleted leases.
2015-09-03 11:35:25 +02:00
Tomek Mrugalski
e626cf0d38
[3681_rebase] MySQLLeaseMgr uses, but does not derive from MySqlConnection.
2015-08-21 18:27:41 +02:00
Marcin Siodelski
a8cc30e9ed
[3965] Fixed build failure due to unused parameters.
2015-08-21 14:01:35 +02:00
Marcin Siodelski
984712536c
[3965] Added stub methods for getting and removing expired leases.
2015-08-20 19:25:38 +02:00
Francis Dupont
8684aede9c
[master] Removed spurious lease_(0) introduced by accident in #3919 marge
2015-06-27 09:12:29 +02:00
Tomek Mrugalski
373aa0a40e
[3681] DataSource class added.
...
- code refactoring after last commit, clean-up, compilation fixes
- Makefile updates
- Added new unit-tests for DataSource (mostly moved from LeaseMgr
unit-tests)
2015-06-25 20:55:12 +02:00
Tomek Mrugalski
2a3ac3ef7d
[3681] MySQLConnection class implemented
...
- patch as sent by Adam Kalmus
2015-06-25 20:55:12 +02:00
Francis Dupont
0abfa6ad2e
[3919] Added some missing initializations
2015-06-24 13:41:20 +02:00
Francis Dupont
7edc41b888
[3882a] Added a comma before library
2015-06-20 15:13:23 +02:00
Francis Dupont
52fe5e23eb
[3882a] Added new getDBVersion() class method
2015-06-19 14:30:51 +02:00
Marcin Siodelski
f48f9ebae5
[3673] Updated comments about the max timestamp for the MySQL and PgSQL.
2015-03-11 20:20:09 +01:00
Marcin Siodelski
ccf7e110c2
[3673] The time conversion method in PgSQL calculates expiry time itself.
...
This is to prevent the negative overflows when valid_lft is substracted
from the time_t value. It is also consistent with the MySQL implementation.
2015-03-04 16:19:36 +01:00
Marcin Siodelski
3ec0536917
[3673] Fixed cppcheck errors in the MySQL and PgSQL backends.
...
This is about making some functions static or const.
2015-03-04 15:02:04 +01:00
Marcin Siodelski
4f83df70a2
[3673] Throw DbOperationError exceptions when time conversion fails.
2015-03-04 14:50:37 +01:00
Marcin Siodelski
8fa9106272
[3673] Handle overflows in the time conversions in the MySQL backend.
2015-03-04 13:32:18 +01:00
Marcin Siodelski
c96df51663
[3556] Updated copyright headers.
2014-12-04 14:47:21 +01:00
Tomek Mrugalski
1ea3e6c973
[3556] Reenabled one disabled test (and fixed MySQL to actually pass it)
2014-11-06 19:40:25 +01:00
Tomek Mrugalski
ab0365c68d
[3556] HWAddr support in MySQL implemented.
2014-11-06 19:36:46 +01:00
Tomek Mrugalski
b572132b06
[3555] MySQL update after Lease4->hwaddr_ type changed.
2014-10-21 19:36:53 +02:00
Mukund Sivaraman
7607200420
[1283] Remove toText() calls where IOAddress should be used directly
2014-01-07 11:32:31 +05:30
Marcin Siodelski
672d49074e
[2940] Moved the Memfile backend tests to a generic class.
2013-11-15 12:03:21 +01:00
Tomek Mrugalski
a26a75c948
[3149] Lease6::LeaseType and Pool::PoolType unified.
2013-09-18 15:44:48 +02:00
Thomas Markwalder
923a40c230
[3147] Addressed review comments.
...
Minor changes to logging messages, unit tests, and commentary.
2013-09-18 06:06:37 -04:00
Thomas Markwalder
91c0c0605d
[3147] Implemented use of lease type in MySQL for IPv6 lease queries
...
Added support for lease type discrimination in IPv6 lease
operations in MySQL backend used by DHCP6, dhcpsrv/mysql_lease_mgr
2013-09-13 10:05:28 -04:00
Tomek Mrugalski
0b0bb4a278
[3146] getLease6() renamed to getLeases6()
2013-09-06 19:30:35 +02:00
Tomek Mrugalski
681def2806
[3146] getLease6 renamed to getLeases6(), single lease getLease6() added
2013-09-06 18:16:50 +02:00
Tomek Mrugalski
95729b096e
[3146] getLease6() methods now have extra param: LeaseType
2013-09-06 14:51:59 +02:00
Marcin Siodelski
7feab5bbe6
[3084] Addressed review comments.
2013-08-30 16:18:40 +02:00
Marcin Siodelski
f09a4f68f8
[3084] Use FQDN data from the lease database to create lease instance.
2013-08-27 13:36:00 +02:00
Marcin Siodelski
879bf7b43d
[3084] Modified MySQL bind statements to include FQDN data.
...
Also, included FQDN fields in the MySQL script creating database.
2013-08-26 17:30:56 +02:00
Thomas Markwalder
cac02e9290
[master] Merge branch 'trac2837' always use STRICT_SQL mode in
...
mysql_lease_mgr.
2013-04-09 15:16:32 -04:00
Thomas Markwalder
2b7e75de16
[2837] Addressed review comments.
2013-04-09 06:55:06 -04:00
Tomek Mrugalski
4972675716
[master] Merge branch 'trac2723' (too short/null DUIDs handing)
...
Conflicts:
ChangeLog
src/lib/dhcpsrv/mysql_lease_mgr.cc
2013-03-28 16:17:47 +01:00
Thomas Markwalder
ab624f466e
[2837] Changed mysql to enforce STRICT mode
...
Changes:
- hwaddr.h - added MAX_HWADDR_LEN
- hwaddr.cc - modified constructor to throw InvalidParameter
if input address is too big
- hwaddr_unittest.cc - added tests for new constructor throws
- lease_mgr.h - removed HWADDR_MAX
- mysql_lease_mgr.cc - added logic to set SQL mode to STRICT
- tests/mysql_lease_mgr_unittest.cc - modified tests that were
failing on STRICT mode, to expect exceptions.
2013-03-15 14:19:42 -04:00
Thomas Markwalder
4813e06cf4
[2825] Removed "mysql" directory prefix from #include statements.
...
The include path for MySQL includes is accurately set by mysql_config.
2013-03-14 08:50:20 -04:00
Jeremy C. Reed
72b8ac6172
[master] various more typo and misspelling fixes
...
Some slight grammar changes.
Mostly in comments, but some for api docs.
Changes a isc_throw output too.
Reviewed via jabber.
2013-03-08 10:32:43 -06:00
Stephen Morris
b11b84e52d
[2821] Updated documentation related to MySqlHolder class.
2013-03-07 23:00:23 +00:00
Jelte Jansen
e58c2fd32c
[2821] Move MySqlHolder to header, and use as member
...
Half-related change, if available, call mysql_library_end() at the end of the unit test run
2013-03-07 15:48:51 +01:00
Tomek Mrugalski
a043d8ecda
[2723] Changes after review.
2013-03-07 15:21:00 +01:00
Jelte Jansen
21dae0aa02
[2821] Small memory leak issue in MySQLLeaseMgr constructor
...
the mysql lease manager wouldn't close the mysql database immediately if initialization failed at certain points.
This proposed fix is not entirely complete; it would probably be better to either use such a holder class as the member, or to slightly clean it up so that the return value from release() can be given to mysql_ (and therefore use the holder in the construction code instead of mysql_), but I did not want to touch too much existing code at this point.
2013-02-25 17:22:48 +01:00
Tomek Mrugalski
6cbb6ed662
[2723] Test for lease4 with null client-id added, some fixes in MySQL.
2013-02-21 16:50:59 +01:00
Tomek Mrugalski
b5e2be95d2
[2697] Another fix for empty client-id, this time in MySQL LeaseMgr
2013-02-07 16:58:41 +01:00