[med-svn] r3082 - trunk/packages/mlstdbnet/trunk/debian/patches
tille at alioth.debian.org
tille at alioth.debian.org
Thu Feb 5 12:22:19 UTC 2009
Author: tille
Date: 2009-02-05 12:22:18 +0000 (Thu, 05 Feb 2009)
New Revision: 3082
Added:
trunk/packages/mlstdbnet/trunk/debian/patches/20_curate_sql_fixes.patch
Modified:
trunk/packages/mlstdbnet/trunk/debian/patches/series
Log:
Patches which deal with initially empty database and SQL quotes
Added: trunk/packages/mlstdbnet/trunk/debian/patches/20_curate_sql_fixes.patch
===================================================================
--- trunk/packages/mlstdbnet/trunk/debian/patches/20_curate_sql_fixes.patch (rev 0)
+++ trunk/packages/mlstdbnet/trunk/debian/patches/20_curate_sql_fixes.patch 2009-02-05 12:22:18 UTC (rev 3082)
@@ -0,0 +1,21 @@
+--- mlstdbnet_v2.0.0.orig/cgi-bin/curate.pl
++++ mlstdbnet_v2.0.0/cgi-bin/curate.pl
+@@ -842,7 +842,8 @@
+ sub curator_name {
+ my $username = $q->remote_user;
+ if ($username) {
+- my $qry = "SELECT first_name, surname FROM users WHERE user_name=?";
++ # String needs quoting - at least in PostgreSQL 8.3
++ my $qry = "SELECT first_name, surname FROM users WHERE user_name='?'";
+ my $sql = $db->prepare($qry) or die "cannot prepare";
+ $sql->execute($username);
+ my @name = $sql->fetchrow_array;
+@@ -1286,6 +1287,8 @@
+
+ sub stExists {
+ my ($st) = @_;
++ # In case of an empty database return 0
++ if ( ! $st ) { return 0 ; }
+ my ($num) = &runSimpleQuery("SELECT COUNT(*) FROM profiles WHERE st=$st");
+ return $num;
+ }
Modified: trunk/packages/mlstdbnet/trunk/debian/patches/series
===================================================================
--- trunk/packages/mlstdbnet/trunk/debian/patches/series 2009-02-05 00:15:04 UTC (rev 3081)
+++ trunk/packages/mlstdbnet/trunk/debian/patches/series 2009-02-05 12:22:18 UTC (rev 3082)
@@ -1,3 +1,4 @@
10_preconf.patch
10_config_location.patch
13_ident_authentication.patch
+20_curate_sql_fixes.patch
More information about the debian-med-commit
mailing list