diff --git a/src/backend/access/spgist/spgtextproc.c b/src/backend/access/spgist/spgtextproc.c
index 5b7a5a0..534d39f 100644
--- a/src/backend/access/spgist/spgtextproc.c
+++ b/src/backend/access/spgist/spgtextproc.c
@@ -234,14 +234,17 @@ spg_text_choose(PG_FUNCTION_ARGS)
 	{
 		/*
 		 * Can't use AddNode action, so split the tuple.  The upper tuple has
-		 * the same prefix as before and uses an empty node label for the
-		 * lower tuple.  The lower tuple has no prefix and the same node
-		 * labels as the original tuple.
+		 * the same prefix as before and uses an the same node label as
+		 * the original tuple. That's prevents  indistinguishability of
+		 * end of string marker and node pointed to allTheSame branch.
+		 * The lower tuple has no prefix and the same node
+		 * labels as the original tuple, but this label will not be
+		 * included in reconstructedValue.
 		 */
 		out->resultType = spgSplitTuple;
 		out->result.splitTuple.prefixHasPrefix = in->hasPrefix;
 		out->result.splitTuple.prefixPrefixDatum = in->prefixDatum;
-		out->result.splitTuple.nodeLabel = UInt8GetDatum('\0');
+		out->result.splitTuple.nodeLabel = in->nodeLabels[0];
 		out->result.splitTuple.postfixHasPrefix = false;
 	}
 	else
@@ -427,8 +430,14 @@ spg_text_inner_consistent(PG_FUNCTION_ARGS)
 		bool		res = true;
 		int			j;
 
-		/* If nodeChar is zero, don't include it in data */
-		if (nodeChar == '\0')
+		/*
+		 *If nodeChar is zero, don't include it in data, because it's a
+		 * marker end of string. If tuple is a allTheSame then don't
+		 * include too - it node's label is just a placeholder.
+		 * See comments in spg_text_choose() near if (in->allTheSame)
+		 * branch
+		 */
+		if (nodeChar == '\0' || in->allTheSame)
 			thisLen = maxReconstrLen - 1;
 		else
 		{
