]> 91.132.146.200 Git - insipid.git/commitdiff
new branch with new fixes
authorBanana <mail@bananas-playground.net>
Sun, 7 Mar 2021 15:31:23 +0000 (16:31 +0100)
committerBanana <mail@bananas-playground.net>
Sun, 7 Mar 2021 15:31:23 +0000 (16:31 +0100)
ChangeLog
webroot/lib/link.class.php
webroot/lib/management.class.php

index 42fbc385d05f8a8ab39992efb21b0ea73747243c..ff1eb159d7eb5b8c8c6ff11cf5b551e036f2bb00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+version 2.5.3 - Hypostyle
+       + Fixed sql problems with Maria DB. Any_value is not supported there
+
 version 2.5.2 - Darkmere (2020-09-12)
 
     + Fixed bug #8 It is possible to add empty tags and categories.
@@ -5,7 +8,6 @@ version 2.5.2 - Darkmere (2020-09-12)
     + Fixed bug #7 Edit categories/tags. Rename and move
     + Fixed feature #3 Reduce whitespace in frontend
 
-
 version 2.5.1 - Caves of Circe (2020-03-22)
 
     + Bugfix release
index d85943f08157fbd7bd559e10b8d9be1dd223b5f5..64793d6632282f26b5454c1ccd6f78a89fd0aa32 100644 (file)
@@ -55,15 +55,15 @@ class Link {
 
                if (!empty($hash)) {
                        $queryStr = "SELECT
-                               any_value(`id`) as id,
-                               any_value(`link`) as link,
-                               any_value(`created`) as created,
-                               any_value(`updated`) as `updated`,
-                               any_value(`status`) as `status`,
-                               any_value(`description`) as description,
-                               any_value(`title`) as title,
-                               any_value(`image`) as image,
-                               any_value(`hash`) as hash
+                               `id`,
+                               `link`,
+                               `created`,
+                               `updated`,
+                               `status`,
+                               `description`,
+                               `title`,
+                               `image`,
+                               `hash`
                                FROM `" . DB_PREFIX . "_link`
                                WHERE `hash` = '" . $this->DB->real_escape_string($hash) . "'";
                        $query = $this->DB->query($queryStr);
@@ -93,13 +93,7 @@ class Link {
                $this->_data = array();
 
                if (!empty($hash)) {
-                       $queryStr = "SELECT
-                               any_value(`id`) as id,
-                               any_value(`link`) as link,
-                               any_value(`description`) as description,
-                               any_value(`title`) as title,
-                               any_value(`image`) as image,
-                               any_value(`hash`) as hash
+                       $queryStr = "SELECT `id`,`link`,`description`,`title`,`image`,`hash`
                                FROM `" . DB_PREFIX . "_link`
                                WHERE `hash` = '" . $this->DB->real_escape_string($hash) . "'";
 
index 08ce708075caa196bf3c30f305d96900f41b55bc..2fe8e719178db64dfd9cd6c3c8f17c669ee429ef 100644 (file)
@@ -30,18 +30,18 @@ class Management {
 
        const LINK_QUERY_STATUS = 2;
 
-       const COMBINED_SELECT_VALUES = "any_value(`id`) as id,
-                               any_value(`link`) as link,
-                               any_value(`created`) as created,
-                               any_value(`status`) as `status`,
-                               any_value(`description`) as description,
-                               any_value(`title`) as title,
-                               any_value(`image`) as image,
-                               any_value(`hash`) as hash,
-                               any_value(`tag`) as tag,
-                               any_value(`category`) as category,
-                               any_value(`categoryId`) as categoryId,
-                               any_value(`tagId`) as tagId";
+       const COMBINED_SELECT_VALUES = "`id`,
+                               `link`,
+                               `created`,
+                               `status`,
+                               `description`,
+                               `title`,
+                               `image`,
+                               `hash`,
+                               `tag`,
+                               `category`,
+                               `categoryId`,
+                               `tagId`";
 
        /**
         * the database object
@@ -98,7 +98,7 @@ class Management {
                if($stats === true) {
                        $queryStr = "SELECT
                                COUNT(*) AS amount,
-                               any_value(cr.categoryid) AS categoryId
+                               cr.categoryid AS categoryId
                                FROM `".DB_PREFIX."_categoryrelation` AS cr, `".DB_PREFIX."_link` AS t
                                WHERE cr.linkid = t.id";
                        $queryStr .= " AND ".$this->_decideLinkTypeForQuery();
@@ -112,9 +112,7 @@ class Management {
                        }
                }
 
-               $queryStr = "SELECT
-                       any_value(`id`) as id,
-                       any_value(`name`) as name
+               $queryStr = "SELECT `id`, `name`
                        FROM `".DB_PREFIX."_category`
                        ORDER BY `name` ASC";
                if(!empty($limit)) {
@@ -148,9 +146,8 @@ class Management {
                $statsInfo = array();
 
                if($stats === true) {
-                       $queryStr = "SELECT
-                               COUNT(*) AS amount,
-                               any_value(tr.tagid) AS tagId
+                       $queryStr = "SELECT COUNT(*) AS amount,
+                               tr.tagid AS tagId
                                FROM `".DB_PREFIX."_tagrelation` AS tr,  `".DB_PREFIX."_link` AS t
                                WHERE tr.linkid = t.id";
                        $queryStr .= " AND ".$this->_decideLinkTypeForQuery();
@@ -164,9 +161,7 @@ class Management {
                        }
                }
 
-               $queryStr = "SELECT
-                       any_value(`id`) as id,
-                       any_value(`name`) as name
+               $queryStr = "SELECT `id`, `name`
                        FROM `".DB_PREFIX."_tag`
                        ORDER BY `name` ASC";
                if(!empty($limit)) {
@@ -864,4 +859,3 @@ class Management {
                return $ret;
        }
 }
-