ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PApp-SQL/SQL.xs
(Generate patch)

Comparing PApp-SQL/SQL.xs (file contents):
Revision 1.6 by root, Sun Apr 22 17:03:28 2001 UTC vs.
Revision 1.8 by root, Sat Aug 11 02:46:16 2001 UTC

79 79
80 dbh = SvRV (dbh); 80 dbh = SvRV (dbh);
81 81
82 lru_hash; 82 lru_hash;
83 83
84 /*fprintf (stderr, "F: %08lx %s\n", hash, SvPV_nolen (sql));/*D*/
85
86 n = &lru_list; 84 n = &lru_list;
87 do { 85 do {
88 n = n->next; 86 n = n->next;
89 if (!n->hash) 87 if (!n->hash)
90 return 0; 88 return 0;
112 n = lru_list.prev; 110 n = lru_list.prev;
113 111
114 lru_list.prev = n->prev; 112 lru_list.prev = n->prev;
115 n->prev->next = &lru_list; 113 n->prev->next = &lru_list;
116 114
117 /*fprintf (stderr, "N: %s\n", SvPV_nolen (n->sql));/*D*/
118
119 SvREFCNT_dec (n->dbh); 115 SvREFCNT_dec (n->dbh);
120 SvREFCNT_dec (n->sql); 116 SvREFCNT_dec (n->sql);
121 SvREFCNT_dec (n->sth); 117 SvREFCNT_dec (n->sth);
122 Safefree (n); 118 Safefree (n);
123 119
134 char *statement = SvPV (sql, len); 130 char *statement = SvPV (sql, len);
135 131
136 dbh = SvRV (dbh); 132 dbh = SvRV (dbh);
137 133
138 lru_hash; 134 lru_hash;
139
140 /*fprintf (stderr, "S: %08lx %s\n", hash, SvPV_nolen (sql));/*D*/
141 135
142 lru_size++; 136 lru_size++;
143 if (lru_size > lru_maxsize) 137 if (lru_size > lru_maxsize)
144 lru_nukeone (); 138 lru_nukeone ();
145 139
272 { 266 {
273 SV *neu = sv_2mortal (newSVpv ("select count(*) > 0 from ", 0)); 267 SV *neu = sv_2mortal (newSVpv ("select count(*) > 0 from ", 0));
274 sv_catsv (neu, sql); 268 sv_catsv (neu, sql);
275 sv_catpv (neu, " limit 1"); 269 sv_catpv (neu, " limit 1");
276 sql = neu; 270 sql = neu;
277 ix -= 6; /* sql_fetch */ 271 ix -= 4; /* sql_fetch */
278 } 272 }
279 273
280 /* check cache for existing statement handle */ 274 /* check cache for existing statement handle */
281 sth = lru_fetch (dbh, sql); 275 sth = lru_fetch (dbh, sql);
282 if (!sth) 276 if (!sth)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines