• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

firtst release


Commit MetaInfo

Révision628fa91f79b76b4f7351a5644f292f91d77eb7ce (tree)
l'heure2013-11-18 19:08:05
AuteurShigeru HANADA <shigeru.hanada@gmai...>
CommiterShigeru HANADA

Message de Log

Rowsヒントの絶対値指定にもプレフィックスを規定

絶対値の場合は「#10」のようにハッシュを前置する。

Change Summary

Modification

--- a/pg_hint_plan.c
+++ b/pg_hint_plan.c
@@ -2058,7 +2058,12 @@ RowsHintParse(RowsHint *hint, HintState *hstate, Query *parse,
20582058
20592059 /* Retieve rows estimation */
20602060 rows_str = list_nth(name_list, hint->nrels);
2061- if (rows_str[0] == '+')
2061+ if (rows_str[0] == '#')
2062+ {
2063+ hint->value_type = RVT_ABSOLUTE;
2064+ rows_str++;
2065+ }
2066+ else if (rows_str[0] == '+')
20622067 {
20632068 hint->value_type = RVT_ADD;
20642069 rows_str++;
@@ -2080,7 +2085,11 @@ RowsHintParse(RowsHint *hint, HintState *hstate, Query *parse,
20802085 }
20812086 else
20822087 {
2083- hint->value_type = RVT_ABSOLUTE;
2088+ hint_ereport(str,
2089+ ("unrecognized rows value type notation.",
2090+ hint->base.keyword));
2091+ hint->base.state = HINT_STATE_ERROR;
2092+ return str;
20842093 }
20852094 hint->rows = strtod(rows_str, &end_ptr);
20862095 if (*end_ptr)
--- a/sql/pg_hint_plan.sql
+++ b/sql/pg_hint_plan.sql
@@ -845,3 +845,10 @@ BEGIN
845845 END;
846846 $$;
847847 DROP EXTENSION pg_hint_plan;
848+
849+-- Rows hint tests
850+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
851+/*+ Rows(t1 t2 #10) */
852+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);
853+/*+ Rows(t1 t2 *10) */
854+EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);