📄 regress.sgml
字号:
midnight tomorrow are exactly twenty-four hours --- which is wrong if daylight-saving time went into or out of effect meanwhile. </para> <note> <para> Because USA daylight-saving time rules are used, this problem always occurs on the first Sunday of April, the last Sunday of October, and their following Mondays, regardless of when daylight-saving time is in effect where you live. Also note that the problem appears or disappears at midnight Pacific time (UTC-7 or UTC-8), not midnight your local time. Thus the failure may appear late on Saturday or persist through much of Tuesday, depending on where you live. </para> </note> <para> Most of the date and time results are dependent on the time zone environment. The reference files are generated for time zone <literal>PST8PDT</literal> (Berkeley, California), and there will be apparent failures if the tests are not run with that time zone setting. The regression test driver sets environment variable <envar>PGTZ</envar> to <literal>PST8PDT</literal>, which normally ensures proper results. However, your operating system must provide support for the <literal>PST8PDT</literal> time zone, or the time zone-dependent tests will fail. To verify that your machine does have this support, type the following:<screen>env TZ=PST8PDT date</screen> The command above should have returned the current system time in the <literal>PST8PDT</literal> time zone. If the <literal>PST8PDT</literal> time zone is not available, then your system may have returned the time in UTC. If the <literal>PST8PDT</literal> time zone is missing, you can set the time zone rules explicitly:<programlisting>PGTZ='PST8PDT7,M04.01.0,M10.05.03'; export PGTZ</programlisting> </para> <para> There appear to be some systems that do not accept the recommended syntax for explicitly setting the local time zone rules; you may need to use a different <envar>PGTZ</envar> setting on such machines. </para> <para> Some systems using older time-zone libraries fail to apply daylight-saving corrections to dates before 1970, causing pre-1970 <acronym>PDT</acronym> times to be displayed in <acronym>PST</acronym> instead. This will result in localized differences in the test results. </para> </sect2> <sect2> <title>Floating-point differences</title> <para> Some of the tests involve computing 64-bit floating-point numbers (<type>double precision</type>) from table columns. Differences in results involving mathematical functions of <type>double precision</type> columns have been observed. The <literal>float8</> and <literal>geometry</> tests are particularly prone to small differences across platforms, or even with different compiler optimization options. Human eyeball comparison is needed to determine the real significance of these differences which are usually 10 places to the right of the decimal point. </para> <para> Some systems display minus zero as <literal>-0</>, while others just show <literal>0</>. </para> <para> Some systems signal errors from <function>pow()</function> and <function>exp()</function> differently from the mechanism expected by the current <productname>PostgreSQL</productname> code. </para> </sect2> <sect2> <title>Row ordering differences</title> <para>You might see differences in which the same rows are output in adifferent order than what appears in the expected file. In most casesthis is not, strictly speaking, a bug. Most of the regression testscripts are not so pedantic as to use an <literal>ORDER BY</> for every single<literal>SELECT</>, and so their result row orderings are not well-definedaccording to the letter of the SQL specification. In practice, since we arelooking at the same queries being executed on the same data by the samesoftware, we usually get the same result ordering on all platforms, andso the lack of <literal>ORDER BY</> isn't a problem. Some queries do exhibitcross-platform ordering differences, however. (Ordering differencescan also be triggered by non-C locale settings.) </para> <para>Therefore, if you see an ordering difference, it's not something toworry about, unless the query does have an <literal>ORDER BY</> that your resultis violating. But please report it anyway, so that we can add an<literal>ORDER BY</> to that particular query and thereby eliminate the bogus<quote>failure</quote> in future releases. </para> <para>You might wonder why we don't order all the regression test queries explicitly toget rid of this issue once and for all. The reason is that that wouldmake the regression tests less useful, not more, since they'd tendto exercise query plan types that produce ordered results to theexclusion of those that don't. </para> </sect2> <sect2> <title>The <quote>random</quote> test</title> <para> There is at least one case in the <literal>random</literal> test script that is intended to produce random results. This causes random to fail the regression test once in a while (perhaps once in every five to ten trials). Typing<programlisting>diff results/random.out expected/random.out</programlisting> should produce only one or a few lines of differences. You need not worry unless the random test always fails in repeated attempts. (On the other hand, if the random test is <emphasis>never</emphasis> reported to fail even in many trials of the regression tests, you probably <emphasis>should</emphasis> worry.) </para> </sect2> </sect1><!-- We might want to move the following section into the developer's guide. --> <sect1 id="regress-platform"> <title>Platform-specific comparison files</title> <para> Since some of the tests inherently produce platform-specific results, we have provided a way to supply platform-specific result comparison files. Frequently, the same variation applies to multiple platforms; rather than supplying a separate comparison file for every platform, there is a mapping file that defines which comparison file to use. So, to eliminate bogus test <quote>failures</quote> for a particular platform, you must choose or make a variant result file, and then add a line to the mapping file, which is <filename>src/test/regress/resultmap</filename>. </para> <para> Each line in the mapping file is of the form<synopsis>testname/platformpattern=comparisonfilename</synopsis> The test name is just the name of the particular regression test module. The platform pattern is a pattern in the style of the Unix tool <command>expr</> (that is, a regular expression with an implicit <literal>^</literal> anchor at the start). It is matched against the platform name as printed by <command>config.guess</command> followed by <literal>:gcc</literal> or <literal>:cc</literal>, depending on whether you use the GNU compiler or the system's native compiler (on systems where there is a difference). The comparison file name is the name of the substitute result comparison file. </para> <para> For example: some systems using older time zone libraries fail to apply daylight-saving corrections to dates before 1970, causing pre-1970 <acronym>PDT</acronym> times to be displayed in <acronym>PST</acronym> instead. This causes a few differences in the <filename>horology</> regression test. Therefore, we provide a variant comparison file, <filename>horology-no-DST-before-1970.out</filename>, which includes the results to be expected on these systems. To silence the bogus <quote>failure</quote> message on <systemitem>HPUX</systemitem> platforms, <filename>resultmap</filename> includes<programlisting>horology/.*-hpux=horology-no-DST-before-1970</programlisting> which will trigger on any machine for which the output of <command>config.guess</command> includes <literal>-hpux</literal>. Other lines in <filename>resultmap</> select the variant comparison file for other platforms where it's appropriate. </para> </sect1> </chapter><!-- Keep this comment at the end of the fileLocal variables:mode:sgmlsgml-omittag:nilsgml-shorttag:tsgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:1sgml-indent-data:tsgml-parent-document:nilsgml-default-dtd-file:"./reference.ced"sgml-exposed-tags:nilsgml-local-catalogs:("/usr/lib/sgml/catalog")sgml-local-ecat-files:nilEnd:-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -