Bug 171546 - [PATCH] databases/mysql55-server: Allow compilation using Clang in C++11 mode
Summary: [PATCH] databases/mysql55-server: Allow compilation using Clang in C++11 mode
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 17:00 UTC by Michael Gmelin
Modified: 2013-04-23 11:20 UTC (History)
1 user (show)

See Also:


Attachments
mysql-server-5.5.27.patch (5.11 KB, patch)
2012-09-11 17:00 UTC, Michael Gmelin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gmelin 2012-09-11 17:00:12 UTC
Those patches add static_cast<int>(...) in various places, since the
implicit type conversation from size_t (return value of my_offsetof)
to int (member offset of struct File_option) is not allowed anymore
when using clang++ -std=c++11.

Since this patch is only relevant at compile time I didn't bump the
PORTREVISION.

Added file(s):
- files/patch-sql-sql__trigger.cc
- files/patch-sql-sql__view.cc

Port maintainer (ale@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-09-11 17:00:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2012-09-13 09:01:34 UTC
State Changed
From-To: open->feedback

Why don't you submit the patch upstream? It's not a FreeBSD specific issue.
Comment 3 Michael Gmelin 2012-09-13 12:43:04 UTC
Good point, I created a MySQL account and submitted a feature request:

http://bugs.mysql.com/bug.php?id=66803&thanks=5&notify=3

I would still like to see this committed to ports until it makes it
upstream (in case it makes into 5.5.x at all), but that's up to you.
Comment 4 Michael Gmelin 2012-12-22 16:50:55 UTC
The patch has been approved upstream a while ago, but hasn't made it
into 5.5 yet (the update to 5.5.29 doesn't contain
the modifications), see also
http://bugs.mysql.com/bug.php?id=66803&thanks=5&notify=3

In case you're more comfortable waiting for Oracle I'd suggest you
close this PR.

Thanks,
Michael

-- 
Michael Gmelin
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-04-23 11:18:10 UTC
Author: ale
Date: Tue Apr 23 10:18:02 2013
New Revision: 316335
URL: http://svnweb.freebsd.org/changeset/ports/316335

Log:
  Allow compilation using Clang in C++11 mode.
  
  PR:		ports/171546
  Submitted by:	Michael Gmelin <freebsd@grem.de>

Added:
  head/databases/mysql56-server/files/patch-sql_sql_trigger.cc   (contents, props changed)
  head/databases/mysql56-server/files/patch-sql_sql_view.cc   (contents, props changed)

Added: head/databases/mysql56-server/files/patch-sql_sql_trigger.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/mysql56-server/files/patch-sql_sql_trigger.cc	Tue Apr 23 10:18:02 2013	(r316335)
@@ -0,0 +1,50 @@
+--- sql/sql_trigger.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_trigger.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -192,32 +192,32 @@ static File_option triggers_file_parameters[]=
+ {
+   {
+     { C_STRING_WITH_LEN("triggers") },
+-    my_offsetof(class Table_triggers_list, definitions_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definitions_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("sql_modes") },
+-    my_offsetof(class Table_triggers_list, definition_modes_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+     FILE_OPTIONS_ULLLIST
+   },
+   {
+     { C_STRING_WITH_LEN("definers") },
+-    my_offsetof(class Table_triggers_list, definers_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definers_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("client_cs_names") },
+-    my_offsetof(class Table_triggers_list, client_cs_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, client_cs_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("connection_cl_names") },
+-    my_offsetof(class Table_triggers_list, connection_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, connection_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("db_cl_names") },
+-    my_offsetof(class Table_triggers_list, db_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, db_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   { { 0, 0 }, 0, FILE_OPTIONS_STRING }
+@@ -226,7 +226,7 @@ static File_option triggers_file_parameters[]=
+ File_option sql_modes_parameters=
+ {
+   { C_STRING_WITH_LEN("sql_modes") },
+-  my_offsetof(class Table_triggers_list, definition_modes_list),
++  static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+   FILE_OPTIONS_ULLLIST
+ };
+ 

Added: head/databases/mysql56-server/files/patch-sql_sql_view.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/mysql56-server/files/patch-sql_sql_view.cc	Tue Apr 23 10:18:02 2013	(r316335)
@@ -0,0 +1,63 @@
+--- sql/sql_view.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_view.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -730,46 +730,46 @@ static const int required_view_parameters= 14;
+ */
+ static File_option view_parameters[]=
+ {{{ C_STRING_WITH_LEN("query")},
+-  my_offsetof(TABLE_LIST, select_stmt),
++  static_cast<int>(my_offsetof(TABLE_LIST, select_stmt)),
+   FILE_OPTIONS_ESTRING},
+  {{ C_STRING_WITH_LEN("md5")},
+-  my_offsetof(TABLE_LIST, md5),
++  static_cast<int>(my_offsetof(TABLE_LIST, md5)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("updatable")},
+-  my_offsetof(TABLE_LIST, updatable_view),
++  static_cast<int>(my_offsetof(TABLE_LIST, updatable_view)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("algorithm")},
+-  my_offsetof(TABLE_LIST, algorithm),
++  static_cast<int>(my_offsetof(TABLE_LIST, algorithm)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("definer_user")},
+-  my_offsetof(TABLE_LIST, definer.user),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.user)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("definer_host")},
+-  my_offsetof(TABLE_LIST, definer.host),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.host)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("suid")},
+-  my_offsetof(TABLE_LIST, view_suid),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_suid)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("with_check_option")},
+-  my_offsetof(TABLE_LIST, with_check),
++  static_cast<int>(my_offsetof(TABLE_LIST, with_check)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("timestamp")},
+-  my_offsetof(TABLE_LIST, timestamp),
++  static_cast<int>(my_offsetof(TABLE_LIST, timestamp)),
+   FILE_OPTIONS_TIMESTAMP},
+  {{ C_STRING_WITH_LEN("create-version")},
+-  my_offsetof(TABLE_LIST, file_version),
++  static_cast<int>(my_offsetof(TABLE_LIST, file_version)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("source")},
+-  my_offsetof(TABLE_LIST, source),
++  static_cast<int>(my_offsetof(TABLE_LIST, source)),
+   FILE_OPTIONS_ESTRING},
+  {{(char*) STRING_WITH_LEN("client_cs_name")},
+-  my_offsetof(TABLE_LIST, view_client_cs_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_client_cs_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("connection_cl_name")},
+-  my_offsetof(TABLE_LIST, view_connection_cl_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_connection_cl_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("view_body_utf8")},
+-  my_offsetof(TABLE_LIST, view_body_utf8),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_body_utf8)),
+   FILE_OPTIONS_ESTRING},
+  {{NullS, 0},			0,
+   FILE_OPTIONS_STRING}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Alex Dupre freebsd_committer freebsd_triage 2013-04-23 11:19:22 UTC
State Changed
From-To: feedback->closed

Committed, thanks.
Comment 7 dfilter service freebsd_committer freebsd_triage 2013-04-23 11:19:29 UTC
Author: ale
Date: Tue Apr 23 10:19:15 2013
New Revision: 316336
URL: http://svnweb.freebsd.org/changeset/ports/316336

Log:
  Update to 5.5.31.
  Allow compilation using Clang in C++11 mode [1].
  
  PR:		ports/171546
  Submitted by:	Michael Gmelin <freebsd@grem.de>

Added:
  head/databases/mysql55-server/files/patch-sql_sql_trigger.cc   (contents, props changed)
  head/databases/mysql55-server/files/patch-sql_sql_view.cc   (contents, props changed)
Modified:
  head/databases/mysql55-server/Makefile
  head/databases/mysql55-server/distinfo
  head/databases/mysql55-server/files/patch-sql_CMakeLists.txt

Modified: head/databases/mysql55-server/Makefile
==============================================================================
--- head/databases/mysql55-server/Makefile	Tue Apr 23 10:18:02 2013	(r316335)
+++ head/databases/mysql55-server/Makefile	Tue Apr 23 10:19:15 2013	(r316336)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME?=	mysql
-PORTVERSION=	5.5.30
+PORTVERSION=	5.5.31
 PORTREVISION?=	0
 CATEGORIES=	databases ipv6
 MASTER_SITES=	${MASTER_SITE_MYSQL}

Modified: head/databases/mysql55-server/distinfo
==============================================================================
--- head/databases/mysql55-server/distinfo	Tue Apr 23 10:18:02 2013	(r316335)
+++ head/databases/mysql55-server/distinfo	Tue Apr 23 10:19:15 2013	(r316336)
@@ -1,2 +1,2 @@
-SHA256 (mysql-5.5.30.tar.gz) = 909fe596e0044082a02d2757b742a33b8a3ff399b589603940494d3d3d975053
-SIZE (mysql-5.5.30.tar.gz) = 24499036
+SHA256 (mysql-5.5.31.tar.gz) = 9cdd650b47e3ea864ab40d4ab23fa4a9fdfabc7fd018bf5c9cce30722c0abcea
+SIZE (mysql-5.5.31.tar.gz) = 24608323

Modified: head/databases/mysql55-server/files/patch-sql_CMakeLists.txt
==============================================================================
--- head/databases/mysql55-server/files/patch-sql_CMakeLists.txt	Tue Apr 23 10:18:02 2013	(r316335)
+++ head/databases/mysql55-server/files/patch-sql_CMakeLists.txt	Tue Apr 23 10:19:15 2013	(r316336)
@@ -1,14 +1,14 @@
---- sql/CMakeLists.txt.orig	2010-12-23 17:31:28.000000000 +0100
-+++ sql/CMakeLists.txt	2010-12-23 17:33:36.000000000 +0100
-@@ -245,6 +245,7 @@
+--- sql/CMakeLists.txt.orig	2013-03-25 14:14:58.000000000 +0100
++++ sql/CMakeLists.txt	2013-04-19 14:57:41.000000000 +0200
+@@ -261,6 +261,7 @@ ADD_CUSTOM_TARGET(distclean
  
  IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
  
 +IF(FALSE)
- # We need to create empty directories (data/test) the installation.  
- # This does not work with current CPack due to http://www.cmake.org/Bug/view.php?id=8767
- # Avoid completely empty directories and install dummy file instead.
-@@ -286,6 +287,7 @@
+ # Copy db.opt into data/test/
+ SET(DBOPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/db.opt ) 
+ INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles)
+@@ -301,6 +302,7 @@ ELSE()
    INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
  ENDIF()
  ENDIF()

Added: head/databases/mysql55-server/files/patch-sql_sql_trigger.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/mysql55-server/files/patch-sql_sql_trigger.cc	Tue Apr 23 10:19:15 2013	(r316336)
@@ -0,0 +1,50 @@
+--- sql/sql_trigger.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_trigger.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -192,32 +192,32 @@ static File_option triggers_file_parameters[]=
+ {
+   {
+     { C_STRING_WITH_LEN("triggers") },
+-    my_offsetof(class Table_triggers_list, definitions_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definitions_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("sql_modes") },
+-    my_offsetof(class Table_triggers_list, definition_modes_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+     FILE_OPTIONS_ULLLIST
+   },
+   {
+     { C_STRING_WITH_LEN("definers") },
+-    my_offsetof(class Table_triggers_list, definers_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definers_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("client_cs_names") },
+-    my_offsetof(class Table_triggers_list, client_cs_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, client_cs_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("connection_cl_names") },
+-    my_offsetof(class Table_triggers_list, connection_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, connection_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("db_cl_names") },
+-    my_offsetof(class Table_triggers_list, db_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, db_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   { { 0, 0 }, 0, FILE_OPTIONS_STRING }
+@@ -226,7 +226,7 @@ static File_option triggers_file_parameters[]=
+ File_option sql_modes_parameters=
+ {
+   { C_STRING_WITH_LEN("sql_modes") },
+-  my_offsetof(class Table_triggers_list, definition_modes_list),
++  static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+   FILE_OPTIONS_ULLLIST
+ };
+ 

Added: head/databases/mysql55-server/files/patch-sql_sql_view.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/mysql55-server/files/patch-sql_sql_view.cc	Tue Apr 23 10:19:15 2013	(r316336)
@@ -0,0 +1,63 @@
+--- sql/sql_view.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_view.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -730,46 +730,46 @@ static const int required_view_parameters= 14;
+ */
+ static File_option view_parameters[]=
+ {{{ C_STRING_WITH_LEN("query")},
+-  my_offsetof(TABLE_LIST, select_stmt),
++  static_cast<int>(my_offsetof(TABLE_LIST, select_stmt)),
+   FILE_OPTIONS_ESTRING},
+  {{ C_STRING_WITH_LEN("md5")},
+-  my_offsetof(TABLE_LIST, md5),
++  static_cast<int>(my_offsetof(TABLE_LIST, md5)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("updatable")},
+-  my_offsetof(TABLE_LIST, updatable_view),
++  static_cast<int>(my_offsetof(TABLE_LIST, updatable_view)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("algorithm")},
+-  my_offsetof(TABLE_LIST, algorithm),
++  static_cast<int>(my_offsetof(TABLE_LIST, algorithm)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("definer_user")},
+-  my_offsetof(TABLE_LIST, definer.user),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.user)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("definer_host")},
+-  my_offsetof(TABLE_LIST, definer.host),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.host)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("suid")},
+-  my_offsetof(TABLE_LIST, view_suid),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_suid)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("with_check_option")},
+-  my_offsetof(TABLE_LIST, with_check),
++  static_cast<int>(my_offsetof(TABLE_LIST, with_check)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("timestamp")},
+-  my_offsetof(TABLE_LIST, timestamp),
++  static_cast<int>(my_offsetof(TABLE_LIST, timestamp)),
+   FILE_OPTIONS_TIMESTAMP},
+  {{ C_STRING_WITH_LEN("create-version")},
+-  my_offsetof(TABLE_LIST, file_version),
++  static_cast<int>(my_offsetof(TABLE_LIST, file_version)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("source")},
+-  my_offsetof(TABLE_LIST, source),
++  static_cast<int>(my_offsetof(TABLE_LIST, source)),
+   FILE_OPTIONS_ESTRING},
+  {{(char*) STRING_WITH_LEN("client_cs_name")},
+-  my_offsetof(TABLE_LIST, view_client_cs_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_client_cs_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("connection_cl_name")},
+-  my_offsetof(TABLE_LIST, view_connection_cl_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_connection_cl_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("view_body_utf8")},
+-  my_offsetof(TABLE_LIST, view_body_utf8),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_body_utf8)),
+   FILE_OPTIONS_ESTRING},
+  {{NullS, 0},			0,
+   FILE_OPTIONS_STRING}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"