LCOV - code coverage report
Current view: top level - sql/backends/monet5 - sql_round.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 21 21 100.0 %
Date: 2024-12-19 23:10:26 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :  * SPDX-License-Identifier: MPL-2.0
       3             :  *
       4             :  * This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       7             :  *
       8             :  * Copyright 2024 MonetDB Foundation;
       9             :  * Copyright August 2008 - 2023 MonetDB B.V.;
      10             :  * Copyright 1997 - July 2008 CWI.
      11             :  */
      12             : 
      13             : #include "monetdb_config.h"
      14             : #include "sql.h"
      15             : #include "mal_instruction.h"
      16             : 
      17             : #define CONCAT_2(a, b)          a##b
      18             : #define CONCAT_3(a, b, c)       a##b##c
      19             : 
      20             : #define NIL(t)                  CONCAT_2(t, _nil)
      21             : #define ISNIL(t)                CONCAT_3(is_, t, _nil)
      22             : #define TPE(t)                  CONCAT_2(TYPE_, t)
      23             : #define GDKmin(t)               CONCAT_3(GDK_, t, _min)
      24             : #define GDKmax(t)               CONCAT_3(GDK_, t, _max)
      25             : #define FUN(a, b)               CONCAT_3(a, _, b)
      26             : 
      27             : #define STRING(a)               #a
      28             : 
      29             : #define BIG lng                 /* a larger type */
      30             : 
      31             : static void
      32         109 : finalize_ouput_copy_sorted_property(bat *res, BAT *bn, str msg, bool nils, BUN q, bool istsorted, bool istrevsorted)
      33             : {
      34         109 :         if (bn && !msg) {
      35         108 :                 BATsetcount(bn, q);
      36         108 :                 bn->tnil = nils;
      37         108 :                 bn->tnonil = !nils;
      38         108 :                 bn->tkey = BATcount(bn) <= 1;
      39         108 :                 bn->tsorted = istsorted || BATcount(bn) <= 1;
      40         108 :                 bn->trevsorted = istrevsorted || BATcount(bn) <= 1;
      41         108 :                 *res = bn->batCacheid;
      42         108 :                 BBPkeepref(bn);
      43           1 :         } else if (bn)
      44           1 :                 BBPreclaim(bn);
      45         109 : }
      46             : 
      47             : static void
      48         109 : unfix_inputs(int nargs, ...)
      49             : {
      50         109 :         va_list valist;
      51             : 
      52         109 :         va_start(valist, nargs);
      53         329 :         for (int i = 0; i < nargs; i++) {
      54         220 :                 BAT *b = va_arg(valist, BAT *);
      55         339 :                 BBPreclaim(b);
      56             :         }
      57         109 :         va_end(valist);
      58         109 : }
      59             : 
      60             : #define TYPE bte
      61             : #include "sql_round_impl.h"
      62             : #undef TYPE
      63             : 
      64             : #define TYPE sht
      65             : #include "sql_round_impl.h"
      66             : #undef TYPE
      67             : 
      68             : #define TYPE int
      69             : #include "sql_round_impl.h"
      70             : #undef TYPE
      71             : 
      72             : #define TYPE lng
      73             : #include "sql_round_impl.h"
      74             : #undef TYPE
      75             : 
      76             : #ifdef HAVE_HGE
      77             : #undef BIG
      78             : #define BIG hge
      79             : #define TYPE hge
      80             : #include "sql_round_impl.h"
      81             : #undef TYPE
      82             : #endif

Generated by: LCOV version 1.14