@@ -169,7 +169,8 @@ mi_string *doInsertCN()
169
169
for (i = 0 ; i < colCount ; i ++ ) {
170
170
/* get column name and type id */
171
171
pcolname = mi_column_name (rd , i );
172
- DPRINTF ("logger" , 90 , ("insert: colname: (0x%x) [%s]" , pcolname , pcolname ));
172
+ DPRINTF ("logger" , 90 , ("insert: colname: (0x%x) [%s]" , pcolname , pcolname ));
173
+ printf ("\n\"Reading TABLENAME-ColumnName\": \"%s-%s\" \n" ,tabname ,pcolname );
173
174
tid = mi_column_type_id (rd , i );
174
175
switch (mi_value (row , i , & datum , & collen )) {
175
176
/* we should do this test */
@@ -429,6 +430,7 @@ mi_string *doUpdateCN()
429
430
if (j < colCountNew )
430
431
pnewcolname = mi_column_name (rdNew , j );
431
432
tid = mi_column_type_id (rdOld , i );
433
+ printf ("\"Reading TABLENAME-ColumnName\": \"%s-%s\" \n" ,ptabname ,pnewcolname );
432
434
switch (mi_value (oldRow , i , & datum , & collen )) {
433
435
/* we should do this test */
434
436
case MI_NULL_VALUE :
@@ -517,45 +519,19 @@ char* gettimestamp()
517
519
strftime (timebuffer ,30 ,"%Y-%m-%dT%T." ,localtime (& curtime ));
518
520
//printf("%s%ld\n",buffer,tv.tv_usec);
519
521
sprintf (timedate ,"%s%ldZ" ,timebuffer ,tv .tv_usec );
522
+ printf ("\nAllocating memory and strcopy before- getstimestamp\n" );
520
523
char * returnstr = malloc (strlen (timedate ) + 1 );
521
524
strcpy (returnstr ,timedate );
525
+ printf ("\nAllocating memory and strcopy success- getstimestamp\n" );
522
526
//printf("%s",timedate);
523
527
return returnstr ;
524
528
}
525
529
/*--------------------------------------------------------------*/
526
530
/* post topic base don condition*/
527
531
528
532
int posttopic (char * jsondata , char * posturl )
529
- {
530
- // char *postinfo = getenv("POSTTOPIC");
531
- // char *fileeventsurl = "http://ifxpg-migrator.topcoder-dev.com/fileevents";
532
- // char *kafkaeventsurl = "http://ifxpg-migrator.topcoder-dev.com/kafkaevents";
533
- //char *localurl= "http://host.docker.internal:8080/events";
534
- //char *localurl= "http://localhost:8080/events";
535
- /* char *posturl = getenv("POSTURL");
536
- if (!postinfo)
537
- {
538
- printf("no post topic set true or false. defualt it will post topic \n");
539
- // return 0;
540
- }
541
- else
542
- {
543
-
544
- if (strcmp(postinfo, "false") == 0)
545
- {
546
- return 0;
547
- }
548
- }
549
- printf("posting topic \n");
550
- if (!posturl)
551
- {
552
- posturl = fileeventsurl;
553
- //posturl = localurl;
554
- //printf("PATH : %s\n",ap);
555
- printf("no url provide in environment . So it is taking localurl");
556
- }
557
- */
558
- printf ("posting topic to url %s \n" , posturl );
533
+ {
534
+ printf ("\nPosting topic to url %s \n" , posturl );
559
535
CURL * hnd = curl_easy_init ();
560
536
curl_easy_setopt (hnd , CURLOPT_CUSTOMREQUEST , "POST" );
561
537
curl_easy_setopt (hnd , CURLOPT_URL , posturl );
@@ -568,15 +544,9 @@ int posttopic(char *jsondata, char *posturl)
568
544
if (ret != CURLE_OK )
569
545
{
570
546
fprintf (stderr , "curl_easy_perform() failed: %s\n" ,
571
- curl_easy_strerror (ret ));
547
+ curl_easy_strerror (ret ));
572
548
}
573
- /* curl_easy_setopt(hnd, CURLOPT_URL, kafkaeventsurl);
574
- if(ret != CURLE_OK)
575
- {
576
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
577
- curl_easy_strerror(ret));
578
- }
579
- */
549
+ curl_easy_cleanup (hnd );
580
550
return 0 ;
581
551
}
582
552
0 commit comments