van nekem egy UDF-em, ami linux alatt működött 1.5.3-as firebird-el (suse 9.0)
most feltettünk egy debian-ra egy 2.0-ásat és van egy udf-em ami nem működik, a firebird ujraindul és leszakad minden client.
Mi lehet ennek az oka ?
#include stdlib.h
#if TIME_WITH_SYS_TIME
# include sys/time.h
# include time.h
#else
# if HAVE_SYS_TIME_H
# include sys/time.h
# else
# include time.h
# endif
#endif
#include math.h
#include ibase.h
#include "example.h"
//ISC_QUAD newdate;
struct tm tm_date;
int DayOfWeek (int year, int month, int day)
{
int p,q,r,w;
p=(14-month) / 12;
q=month+12*p-2;
r=year-p;
w=(day+(31*q) / 12 + r + r / 4 - r / 100 + r / 400) % 7;
return w;
}
int* EXPORT WEEKOY(ISC_QUAD *s)
{
int i,j;
isc_decode_date(s , &tm_date);
i=tm_date.tm_yday+DayOfWeek(tm_date.tm_year,1,1)+1; //because DayOfWeek first is "0"
j=1+(i/7);
return (int*) j;
}
- 1614 megtekintés