LCOV - differential code coverage report
Current view: top level - src/backend/optimizer/geqo - geqo_random.c (source / functions) Coverage Total Hit CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 10 10 10
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 3 3 3
Baseline: 16@8cea358b128 Branches: - 0 0
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 10 10 10
Function coverage date bins:
(240..) days: 100.0 % 3 3 3

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * geqo_random.c
                                  4                 :                :  *     random number generator
                                  5                 :                :  *
                                  6                 :                :  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
                                  7                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  8                 :                :  *
                                  9                 :                :  * src/backend/optimizer/geqo/geqo_random.c
                                 10                 :                :  *
                                 11                 :                :  *-------------------------------------------------------------------------
                                 12                 :                :  */
                                 13                 :                : 
                                 14                 :                : #include "postgres.h"
                                 15                 :                : 
                                 16                 :                : #include "optimizer/geqo_random.h"
                                 17                 :                : 
                                 18                 :                : 
                                 19                 :                : void
 5386 tgl@sss.pgh.pa.us          20                 :CBC           3 : geqo_set_seed(PlannerInfo *root, double seed)
                                 21                 :                : {
                                 22                 :              3 :     GeqoPrivateData *private = (GeqoPrivateData *) root->join_search_private;
                                 23                 :                : 
  868                            24                 :              3 :     pg_prng_fseed(&private->random_state, seed);
 5386                            25                 :              3 : }
                                 26                 :                : 
                                 27                 :                : double
                                 28                 :            390 : geqo_rand(PlannerInfo *root)
                                 29                 :                : {
                                 30                 :            390 :     GeqoPrivateData *private = (GeqoPrivateData *) root->join_search_private;
                                 31                 :                : 
  868                            32                 :            390 :     return pg_prng_double(&private->random_state);
                                 33                 :                : }
                                 34                 :                : 
                                 35                 :                : int
                                 36                 :           1155 : geqo_randint(PlannerInfo *root, int upper, int lower)
                                 37                 :                : {
                                 38                 :           1155 :     GeqoPrivateData *private = (GeqoPrivateData *) root->join_search_private;
                                 39                 :                : 
                                 40                 :                :     /*
                                 41                 :                :      * In current usage, "lower" is never negative so we can just use
                                 42                 :                :      * pg_prng_uint64_range directly.
                                 43                 :                :      */
                                 44                 :           1155 :     return (int) pg_prng_uint64_range(&private->random_state, lower, upper);
                                 45                 :                : }
        

Generated by: LCOV version 2.1-beta2-3-g6141622