Bug 243793

Summary: www/mod_log_sql2: fix for FreeBSD's PID > 65535 when 'LogSQLCreateTables On'
Product: Ports & Packages Reporter: Tommy P <tommyhp2>
Component: Individual Port(s)Assignee: Bernard Spil <brnrd>
Status: Closed FIXED    
Severity: Affects Only Me CC: brnrd, joneum, tommyhp2
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: bugzilla: maintainer-feedback? (apache)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
contrib/create_tables.sql
none
mod_log_sql_dbi.c
none
mod_log_sql_mysql.c
none
mod_log_sql_pgsql.c
none
combined patches for SQL and *.c files none

Description Tommy P 2020-02-02 09:11:33 UTC

    
Comment 1 Tommy P 2020-02-02 09:12:48 UTC
Created attachment 211268 [details]
contrib/create_tables.sql
Comment 2 Tommy P 2020-02-02 09:13:17 UTC
Created attachment 211269 [details]
mod_log_sql_dbi.c
Comment 3 Tommy P 2020-02-02 09:13:43 UTC
Created attachment 211270 [details]
mod_log_sql_mysql.c
Comment 4 Tommy P 2020-02-02 09:14:06 UTC
Created attachment 211271 [details]
mod_log_sql_pgsql.c
Comment 5 Jochen Neumeister freebsd_committer freebsd_triage 2020-03-08 10:07:36 UTC
Please give a detailed description. Are there any errors? If so, which ones? 
Please a patch, not many small ones. Thanks :-)
Comment 6 Tommy P 2020-03-11 02:22:48 UTC
Created attachment 212322 [details]
combined patches for SQL and *.c files
Comment 7 Tommy P 2020-03-11 02:34:04 UTC
(In reply to Jochen Neumeister from comment #5)
Hi Jochen,

There aren't any errors in the logs that I could see.  I did noticed the SQL file, from the setting LogSQLPreserveFile, got bigger when the DB and web servers have been running for a long time.  When I tried to enter the data manually by running that SQL file, all of the rows failed because the data is larger (> 65535) than column (child_pid) allowed (unsigned smallint).  The patches allow the setting LogSQLCreateTables to work as intended.  I don't recall the max limit of PID on FreeBSD 11.x but on 12.1-RELEASE, I see it goes up to 99922 as of this writing.

Regards,
Tommy
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-08-06 15:09:26 UTC
A commit references this bug:

Author: brnrd
Date: Thu Aug  6 15:09:19 UTC 2020
New revision: 544278
URL: https://svnweb.freebsd.org/changeset/ports/544278

Log:
  www/mod_log_sql: Fix PID > 65535

   * PID > 65535 when 'LogSQLCreateTables On' [1]
   * Fix WWW address
   * 2 suffix (for Apache 2) is redundant, remove

  PR:		243793 [1]
  Submitted by:	Tommy P <tommyhp2 gmail com>

Changes:
  head/MOVED
  head/www/Makefile
  head/www/mod_log_sql/
  head/www/mod_log_sql/Makefile
  head/www/mod_log_sql/pkg-descr
  head/www/mod_log_sql2/
Comment 9 Bernard Spil freebsd_committer freebsd_triage 2020-08-06 15:20:51 UTC
Thanks for the patch!