Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mysql-xml-to-csv for 
openSUSE:Factory checked in at 2025-12-12 21:41:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mysql-xml-to-csv (Old)
 and      /work/SRC/openSUSE:Factory/.mysql-xml-to-csv.new.1939 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mysql-xml-to-csv"

Fri Dec 12 21:41:25 2025 rev:4 rq:1322269 version:1.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/mysql-xml-to-csv/mysql-xml-to-csv.changes        
2025-12-11 18:40:37.747677427 +0100
+++ 
/work/SRC/openSUSE:Factory/.mysql-xml-to-csv.new.1939/mysql-xml-to-csv.changes  
    2025-12-12 21:43:02.217538394 +0100
@@ -1,0 +2,7 @@
+Thu Dec 11 19:17:56 UTC 2025 - Archie Cobbs <[email protected]>
+
+- Update to release 1.0.3.
+  + Minor performance improvements
+  + Fix small memory leak
+
+-------------------------------------------------------------------

Old:
----
  mysql-xml-to-csv-1.0.2.obscpio

New:
----
  mysql-xml-to-csv-1.0.3.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mysql-xml-to-csv.spec ++++++
--- /var/tmp/diff_new_pack.xfrDcQ/_old  2025-12-12 21:43:03.053573666 +0100
+++ /var/tmp/diff_new_pack.xfrDcQ/_new  2025-12-12 21:43:03.053573666 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           mysql-xml-to-csv
-Version:        1.0.2
+Version:        1.0.3
 Release:        0
 Summary:        Convert MySQL XML output to CSV
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.xfrDcQ/_old  2025-12-12 21:43:03.113576198 +0100
+++ /var/tmp/diff_new_pack.xfrDcQ/_new  2025-12-12 21:43:03.117576367 +0100
@@ -2,8 +2,8 @@
     <service mode="localonly" name="obs_scm">
         <param name="scm">git</param>
         <param 
name="url">https://github.com/archiecobbs/mysql-xml-to-csv</param>
-        <param name="versionformat">1.0.2</param>
-        <param name="revision">1.0.2</param>
+        <param name="versionformat">1.0.3</param>
+        <param name="revision">1.0.3</param>
         <param name="filename">mysql-xml-to-csv</param>
     </service>
     <service mode="buildtime" name="tar"/>

++++++ mysql-xml-to-csv-1.0.2.obscpio -> mysql-xml-to-csv-1.0.3.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mysql-xml-to-csv-1.0.2/CHANGES 
new/mysql-xml-to-csv-1.0.3/CHANGES
--- old/mysql-xml-to-csv-1.0.2/CHANGES  2025-12-11 02:50:41.000000000 +0100
+++ new/mysql-xml-to-csv-1.0.3/CHANGES  2025-12-11 19:24:52.000000000 +0100
@@ -1,3 +1,8 @@
+Version 1.0.3 Released December 11, 2025
+
+    - Minor performance improvements
+    - Fix small memory leak
+
 Version 1.0.2 Released December 10, 2025
 
     - Allow invalid control characters in XML to flow through
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mysql-xml-to-csv-1.0.2/configure.ac 
new/mysql-xml-to-csv-1.0.3/configure.ac
--- old/mysql-xml-to-csv-1.0.2/configure.ac     2025-12-11 02:50:41.000000000 
+0100
+++ new/mysql-xml-to-csv-1.0.3/configure.ac     2025-12-11 19:24:52.000000000 
+0100
@@ -16,7 +16,7 @@
 # limitations under the License.
 #
 
-AC_INIT([mysql-xml-to-csv Convert MySQL XML output to CSV], [1.0.2], 
[https://github.com/archiecobbs/mysql-xml-to-csv/], [mysql-xml-to-csv])
+AC_INIT([mysql-xml-to-csv Convert MySQL XML output to CSV], [1.0.3], 
[https://github.com/archiecobbs/mysql-xml-to-csv/], [mysql-xml-to-csv])
 AC_CONFIG_AUX_DIR(scripts)
 AM_INIT_AUTOMAKE
 dnl AM_MAINTAINER_MODE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mysql-xml-to-csv-1.0.2/main.c 
new/mysql-xml-to-csv-1.0.3/main.c
--- old/mysql-xml-to-csv-1.0.2/main.c   2025-12-11 02:50:41.000000000 +0100
+++ new/mysql-xml-to-csv-1.0.3/main.c   2025-12-11 19:24:52.000000000 +0100
@@ -60,7 +60,7 @@
     XML_Char    control;                        // the invalid control 
character that was replaced
     XML_Index   offset;                         // the invalid control 
character's byte offset in the input
 } invalid_control_t;
-static invalid_control_t *invalid_controls;     // invalid control characters 
identified in the current input
+static invalid_control_t *invalid_controls;     // invalid control characters 
in the current input (sorted by offset)
 static size_t invalid_controls_len;
 static size_t invalid_controls_alloc;
 
@@ -83,7 +83,6 @@
 int
 main(int argc, char **argv)
 {
-    char buf[BUFFER_SIZE];
     int want_column_names = 1;                  // output column names as the 
first CSV row
     const char *empty_output = NULL;            // what to print if there are 
zero rows
     XML_Parser p;
@@ -156,9 +155,14 @@
 
     // Process file
     for (offset = 0; 1; offset += r) {
+        char *buf;
+
+        // Get buffer
+        if ((buf = XML_GetBuffer(p, BUFFER_SIZE)) == NULL)
+            errx(1, "XML_GetBuffer(%d) failed", BUFFER_SIZE);
 
         // Read more data
-        if ((r = fread(buf, 1, sizeof(buf), fp)) == 0 && ferror(fp))
+        if ((r = fread(buf, 1, BUFFER_SIZE, fp)) == 0 && ferror(fp))
             errx(1, "error reading input");
 
         // Identify any invalid control characters and replace them with 
placeholders
@@ -187,12 +191,14 @@
         }
 
         // Process it
-        if (XML_Parse(p, buf, r, r == 0) == XML_STATUS_ERROR) {
+        if (XML_ParseBuffer(p, r, r == 0) == XML_STATUS_ERROR) {
             errx(1, "line %u: col %u: %s",
               (unsigned int)XML_GetCurrentLineNumber(p),
               (unsigned int)XML_GetCurrentColumnNumber(p),
               XML_ErrorString(XML_GetErrorCode(p)));
         }
+
+        // EOF?
         if (r == 0)
             break;
     }
@@ -253,6 +259,11 @@
 static void
 handle_elem_text(void *data, const XML_Char *s, int len)
 {
+    const XML_Parser p = data;
+    const XML_Index offset = XML_GetCurrentByteIndex(p);
+    XML_Char *copy = NULL;
+    int i;
+
     if (!reading_value)
         return;
     if (value_is_null) {
@@ -262,54 +273,23 @@
             return;
     }
 
-    /*
-    {
-        int i;
-        fprintf(stderr, "handle_elem_text:\n");
-        fprintf(stderr, "  s=");
-        for (i = 0; i < len; i++)
-          fprintf(stderr, "%02x ", (int)(s[i] & 0xff));
-        fprintf(stderr, "\n");
-        fprintf(stderr, "  invalid_controls_len=%d\n", 
(int)invalid_controls_len);
-        fprintf(stderr, "  invalid_controls_alloc=%d\n", 
(int)invalid_controls_alloc);
-        fprintf(stderr, "  invalid_controls=");
-        for (i = 0; i < invalid_controls_len; i++) {
-            invalid_control_t *const invalid_control = &invalid_controls[i];
-            fprintf(stderr, "%02x@%d ", (int)invalid_control->control & 0xff, 
(int)invalid_control->offset);
-        }
-        fprintf(stderr, "\n");
-    }
-    */
-
-    // Un-replace invalid control characters, if any
-    if (invalid_controls_len > 0) {
-        const XML_Parser p = data;
-        const XML_Index offset = XML_GetCurrentByteIndex(p);
-        XML_Char *s2;
-        int i;
-        int j;
-
-        // Copy data so we can modify it back
-        if ((s2 = malloc(len * sizeof(*s))) == NULL)
-            err(1, "malloc");
-        memcpy(s2, s, len * sizeof(*s));
-        s = s2;
-
-        // Replace placeholders with their original invalid control characters
-        for (i = 0; i < len; i++) {
-            const XML_Char ch = s[i];
-            for (j = 0; j < invalid_controls_len; ) {
-                invalid_control_t *const invalid_control = 
&invalid_controls[j];
-
-                if (invalid_control->offset == offset + i) {
-//                    fprintf(stderr, "    replace: %02x@%d (was %02x)\n",
-//                      (int)invalid_control->control & 0xff, 
(int)invalid_control->offset, (int)(ch & 0xff));
-                    assert(ch == INVALID_CONTROL_PLACEHOLDER);
-                    s2[i] = invalid_control->control;
-                    memcpy(invalid_control, invalid_control + 1, 
(--invalid_controls_len - j) * sizeof(*invalid_control));
-                } else
-                    j++;
+    // Replace placeholders with their original invalid control characters.
+    // Everything goes in order, so only the first in the array can possibly 
match.
+    for (i = 0; i < len && invalid_controls_len > 0; i++) {
+        if (invalid_controls->offset == offset + i) {
+
+            // Copy buffer to make it writeable (first time only)
+            if (copy == NULL) {
+                if ((copy = malloc(len * sizeof(*s))) == NULL)
+                    err(1, "malloc");
+                memcpy(copy, s, len * sizeof(*s));
+                s = copy;
             }
+
+            // Replace placeholder with original invalid control character and 
discard array entry
+            assert(copy[i] == INVALID_CONTROL_PLACEHOLDER);
+            copy[i] = invalid_controls->control;
+            memcpy(invalid_controls, invalid_controls + 1, 
--invalid_controls_len * sizeof(*invalid_controls));
         }
     }
 
@@ -318,6 +298,10 @@
         add_chars(&elem_text, &elem_text_len, s, len);
     else
         output_csv_text(s, len);
+
+    // Free buffer copy
+    if (copy != NULL)
+        free(copy);
 }
 
 static void

++++++ mysql-xml-to-csv.obsinfo ++++++
--- /var/tmp/diff_new_pack.xfrDcQ/_old  2025-12-12 21:43:03.309584468 +0100
+++ /var/tmp/diff_new_pack.xfrDcQ/_new  2025-12-12 21:43:03.309584468 +0100
@@ -1,5 +1,5 @@
 name: mysql-xml-to-csv
-version: 1.0.2
-mtime: 1765417841
-commit: b6186fb9fdcdef2711e296094437ed3f921ea8ed
+version: 1.0.3
+mtime: 1765477492
+commit: 0b6c0572d7c4ebb2ada1bf9e6e8b4090a4faa049
 

Reply via email to