Skip to content
Snippets Groups Projects
Commit cda1a819 authored by Andrzej Lisak's avatar Andrzej Lisak
Browse files

[ABW]: merge with latest develop

parents 06826c9d aca7a645
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!368New tests
This commit is part of merge request !368. Comments created here will be created in the context of that merge request.
...@@ -27,7 +27,7 @@ BEGIN ...@@ -27,7 +27,7 @@ BEGIN
__account_id = find_account_id( _account, True ); __account_id = find_account_id( _account, True );
__start_id = find_account_id( _start, _start <> '' ); __start_id = find_account_id( _start, _start <> '' );
IF __start_id <> 0 THEN IF __start_id <> 0 THEN
SELECT INTO __start_id COALESCE( ( SELECT id FROM hive_follows WHERE following = __account_id AND follower = __start_id ), 0 ); SELECT INTO __start_id ( SELECT id FROM hive_follows WHERE following = __account_id AND follower = __start_id );
END IF; END IF;
RETURN QUERY SELECT RETURN QUERY SELECT
ha.name ha.name
...@@ -55,7 +55,7 @@ BEGIN ...@@ -55,7 +55,7 @@ BEGIN
__account_id = find_account_id( _account, True ); __account_id = find_account_id( _account, True );
__start_id = find_account_id( _start, _start <> '' ); __start_id = find_account_id( _start, _start <> '' );
IF __start_id <> 0 THEN IF __start_id <> 0 THEN
SELECT INTO __start_id COALESCE( ( SELECT id FROM hive_follows WHERE follower = __account_id AND following = __start_id ), 0 ); SELECT INTO __start_id ( SELECT id FROM hive_follows WHERE follower = __account_id AND following = __start_id );
END IF; END IF;
RETURN QUERY SELECT RETURN QUERY SELECT
ha.name ha.name
......
...@@ -10,20 +10,27 @@ AS ...@@ -10,20 +10,27 @@ AS
$function$ $function$
DECLARE DECLARE
__post_id INTEGER := 0; __post_id INTEGER := 0;
__parent_author_id INTEGER := 0;
BEGIN BEGIN
IF _permlink <> '' THEN IF _permlink <> '' THEN
__post_id = find_comment_id( _author, _permlink, True );
SELECT SELECT
ha_pp.name, hp.id pp.author_id
INTO INTO
_author, __post_id __parent_author_id
FROM hive_posts hp FROM hive_posts hp
JOIN hive_posts pp ON hp.parent_id = pp.id JOIN hive_posts pp ON hp.parent_id = pp.id
JOIN hive_accounts ha_pp ON ha_pp.id = pp.author_id WHERE hp.id = __post_id;
JOIN hive_permlink_data hpd_pp ON hpd_pp.id = pp.permlink_id ELSE
JOIN hive_accounts ha ON hp.author_id = ha.id SELECT
WHERE id
hpd_pp.permlink = _permlink AND ha.name = _author; INTO
__parent_author_id
FROM hive_accounts
WHERE name = _author;
END IF; END IF;
RETURN QUERY SELECT RETURN QUERY SELECT
...@@ -64,15 +71,8 @@ BEGIN ...@@ -64,15 +71,8 @@ BEGIN
hp.is_pinned, hp.is_pinned,
hp.curator_payout_value hp.curator_payout_value
FROM hive_posts_view hp FROM hive_posts_view hp
JOIN JOIN hive_posts pp ON hp.parent_id = pp.id
( WHERE pp.author_id = __parent_author_id AND ( ( __post_id = 0 ) OR ( hp.id <= __post_id ) )
SELECT hp.id
FROM hive_posts_view hp
WHERE hp.author = _author
ORDER BY hp.id DESC
LIMIT _limit
) T ON hp.parent_id = T.id
WHERE ( ( __post_id = 0 ) OR ( hp.id <= __post_id ) )
ORDER BY hp.id DESC ORDER BY hp.id DESC
LIMIT _limit; LIMIT _limit;
......
Subproject commit f8ac3e6776ef31f23d14a746b6ba6c281382e9cc Subproject commit 45a18a1ea9617a753a4b1cfac61793247d7adbc8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment