Informix - Problembeschreibung
Problem IC61409 | Status: Geschlossen |
CHANGE DATA CAPTURE API PROGRAMMER'S GUIDE - THE SAMPLE PROGRAM IS OBSOLETE AND NEEDS TO BE UPDATED | |
Produkt: | |
IBM IDS ENTRP E / 5724L2304 / B15 - IDS 11.50 | |
Problembeschreibung: | |
The CDC API sample program which is included in the CDC API Programmer's Guide works with an obsolete identifier for 'PacketScheme' member of CDC record common header ('LGRC'): mint process_databuf(char *databuf, int bytesread) { int logrectype; char recsymb[17], recdesc[128]; if (reminderBytes <= 0) { /* Get the common header information from the CDC packet*/ cur_log_header.ch_size_hdr = ldlong(databuf); cur_log_header.ch_size_payload = ldlong(databuf+4); memcpy((char*)(&cur_log_header.ch_payload_type), (databuf+8),4); /* Check what we got is a correct CDC packet */ if (memcmp((char*)&(cur_log_header.ch_payload_type), "LGRC", 4)!= 0) { fprintf(stderr, "Unknow packet type.\n"); return -1; } ..... } However, the correct value of this identifier is 66 (0x42; CDC_PKTSCHEME_LRECBINARY), so the sample program ends prematurely with "Unknow packet type" error message. The sample program should be modified to use the correct value, for example: 1. define the CDC_PKTSCHEME_LRECBINARY somewhere at the beginning: #define CDC_PKTSCHEME_LRECBINARY ((int4) 66) 2. modify the process_databuf() function to: mint process_databuf(char *databuf, int bytesread) { int logrectype, size; char recsymb[17], recdesc[128]; if (reminderBytes <= 0) { /* Get the common header information from the CDC packet*/ cur_log_header.ch_size_hdr = ldlong(databuf); cur_log_header.ch_size_payload = ldlong(databuf+4); cur_log_header.ch_payload_type = ldlong(databuf+8); /* Check what we got is a correct CDC packet */ if (cur_log_header.ch_payload_type != CDC_PKTSCHEME_LRECBINARY) { fprintf(stderr, "Unknown packet type.\n"); return -1; } ..... } | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * All users of documentation for IDS v11.50.xC4 and earlier. * **************************************************************** * PROBLEM DESCRIPTION: * * The identifier for the Packet Scheme member of the CDC * * record common header is incorrect. This error occurs in the * * Change Data Capture sample program of the Change Data * * Capture API Programmer's Guide. * * * * The incorrect information in the sample program is: * * * * mint * * process_databuf(char *databuf, int bytesread) * * { * * int logrectype; * * char recsymb[17], recdesc[128]; * * * * if (reminderBytes <= 0) * * { * * /* Get the common header information from the CDC packet*/ * * cur_log_header.ch_size_hdr = ldlong(databuf); * * cur_log_header.ch_size_payload = ldlong(databuf+4); * * memcpy((char*)(&cur_log_header.ch_payload_type), * * (databuf+8),4); * * * * /* Check what we got is a correct CDC packet */ * * if (memcmp((char*)&(cur_log_header.ch_payload_type), * * "LGRC", 4) != 0) * * { * * fprintf(stderr, "Unknow packet type.\n"); * * return -1; * * } * * ..... * * } * **************************************************************** * RECOMMENDATION: * * Upgrade to IDS v11.50.xC5 documentation and above. * **************************************************************** | |
Local-Fix: | |
Modify the CDC API sample program as described in Error Description. | |
Lösung | |
To correct the sample program, do the following: 1. Define the CDC_PKTSCHEME_LRECBINARY early in the sample program: #define CDC_PKTSCHEME_LRECBINARY ((int4) 66) 2. Modify the process_databuf() function to the following: mint process_databuf(char *databuf, int bytesread) { int logrectype, size; char recsymb[17], recdesc[128]; if (reminderBytes <= 0) { /* Get the common header information from the CDC packet*/ cur_log_header.ch_size_hdr = ldlong(databuf); cur_log_header.ch_size_payload = ldlong(databuf+4); cur_log_header.ch_payload_type = ldlong(databuf+8); /* Check what we got is a correct CDC packet */ if (cur_log_header.ch_payload_type != CDC_PKTSCHEME_LRECBINARY) { fprintf(stderr, "Unknown packet type.\n"); return -1; } ..... } | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 08.06.2009 19.01.2010 19.01.2010 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
Problem behoben lt. FixList in der Version | |
11.50.xC5 |