Opened 4 years ago

Closed 4 years ago

#4485 closed defect (fixed)

Compilation failure for mysql_host_data_source.cc

Reported by: stephen Owned by: stephen
Priority: medium Milestone: Kea1.1
Component: database-all Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 1 Internal?: no

Description

Ubuntu 12.04, g++ 4.6.3, MySql? 5.5.47

  CXX    libkea_dhcpsrv_la-mysql_host_data_source.lo
mysql_host_data_source.cc: In member function 'std::vector<st_mysql_bind> {anonymous}::MySqlHostExchange::createBindForSend(const HostPtr&)':
mysql_host_data_source.cc:315:32: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
mysql_host_data_source.cc: In member function 'virtual std::vector<st_mysql_bind> {anonymous}::MySqlHostExchange::createBindForReceive()':
mysql_host_data_source.cc:410:28: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
mysql_host_data_source.cc: In member function 'virtual std::vector<st_mysql_bind> {anonymous}::MySqlHostIPv6Exchange::createBindForReceive()':
mysql_host_data_source.cc:826:28: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
mysql_host_data_source.cc: In member function 'std::vector<st_mysql_bind> {anonymous}::MySqlIPv6ReservationExchange::createBindForSend(const isc::dhcp::IPv6Resrv&, const HostID&)':
mysql_host_data_source.cc:951:32: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]

The problem lies the few lines like:

            bind_[1].length = &dhcp_identifier_length_;

bind[1].length is declared as unsigned long*. dhcp_identifier_length_ is declared as size_t.

dhcp_identifier_length_ (and the other variables causing the problem) are temporary ones to hold information being transferred between the module and database: they should be declared as unsigned long.

Estimated time to fix: less than an hour.

Subtickets

Change History (7)

comment:1 Changed 4 years ago by hschempf

  • Milestone changed from Kea-proposed to Kea1.1

per team meeting apr 28, accept 1.1. estimate = .25 days

comment:2 Changed 4 years ago by stephen

  • Owner set to stephen
  • Status changed from new to accepted

comment:3 Changed 4 years ago by stephen

  • Owner changed from stephen to UnAssigned
  • Status changed from accepted to reviewing

Ready for review. The suggested ChangeLog entry is:

Adjusted variable type in one of the mysql-related files to overcome
type mismatch problems reported by a one specific compiler.

comment:4 Changed 4 years ago by stephen

  • Total Hours changed from 0 to 0.5

comment:5 Changed 4 years ago by tomek

  • Owner changed from UnAssigned to tomek
  • Total Hours changed from 0.5 to 0

comment:6 Changed 4 years ago by tomek

  • Owner changed from tomek to stephen
  • Total Hours changed from 0 to 1

The changes are good to go. The code compiles and unit-tests pass on Ubuntu 15.10 x64.

comment:7 Changed 4 years ago by stephen

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merge in commit 4c6fb189b5d12ffdf4ab171c9154366e70e6082c

Note: See TracTickets for help on using tickets.