Dick van der Kaaden wrote:
> I found a cause of the seg faults I mentioned last week. Apparently
> midgard causes apache to seg fault when I try to retrieve a list of
> articles using the mgd_list_topic_calendar_all with time constraint. This
> is on midgard 1.4.1-7 with apache 1.3.19 and php 4.0.5 on a redhat
> 7.0 machine.
>
> Basically showing records using the default value and just specifying a
> topic works. When I try to list all articles that are not in de current
> selection midgard makes apache seg fault and a 404 page is shown.
I haven't yet found the cause of the problem, but the attached patch
may make it go away. This change will skip all entries that do not
have a calstart, but I'm not sure if that's semantically right. David,
thoughts?
Emile
Index: calendar.c
===================================================================
RCS file: /usr/local/cvs/midgard/php4/calendar.c,v
retrieving revision 1.1
diff -u -r1.1 calendar.c
--- calendar.c 2001/04/01 00:23:49 1.1
+++ calendar.c 2001/05/26 11:58:28
@@ -99,7 +99,8 @@
if (typev == -1)
php_midgard_select(&MidgardArticle, return_value,
ARTICLE_SELECT ","
ARTICLE_CALENDAR, ARTICLE_FROM,
- "article.topic IN $D AND
author=person.id"
+ "article.calstart IS NOT NULL"
+ " AND article.topic IN $D AND
+author=person.id"
" AND article.up=0 AND
Unix_Timestamp(calstart)<$d"
" AND 24*60*60-1+Unix_timestamp("
" Date_Add(calstart, INTERVAL
caldays DAY))>$d",
@@ -107,7 +108,8 @@
else
php_midgard_select(&MidgardArticle, return_value,
ARTICLE_SELECT ","
ARTICLE_CALENDAR, ARTICLE_FROM,
- "article.type=$d AND article.topic
IN $D"
+ "article.calstart IS NOT NULL"
+ " AND article.type=$d AND article.topic IN $D"
" AND author=person.id"
" AND article.up=0 AND
Unix_Timestamp(calstart)<$d"
" AND 24*60*60-1+Unix_timestamp("
Index: oop.c
===================================================================
RCS file: /usr/local/cvs/midgard/php4/oop.c,v
retrieving revision 1.3
diff -u -r1.3 oop.c
--- oop.c 2001/04/27 09:29:58 1.3
+++ oop.c 2001/05/26 11:58:28
@@ -421,6 +421,7 @@
{
zval *self;
zval **key;
+ char *value;
midgard_res *res;
int i;
@@ -442,9 +443,11 @@
}
if (mgd_fetch(res)) {
- for (i = 0; i < mgd_cols(res); i++)
+ for (i = 0; i < mgd_cols(res); i++) {
+ value = (char*)mgd_colvalue(res, i);
add_property_string(self, (char*)mgd_colname(res, i),
- (char*)mgd_colvalue(res, i), 1);
+ (value != NULL ? value : ""), 1);
+ }
RETVAL_TRUE;
} else {
mgd_release(res);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]