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-04-25 20:03:45 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          78 : finalize_ouput_copy_sorted_property(bat *res, BAT *bn, str msg, bool nils, BUN q, bool istsorted, bool istrevsorted)
      33             : {
      34          78 :         if (bn && !msg) {
      35          77 :                 BATsetcount(bn, q);
      36          77 :                 bn->tnil = nils;
      37          77 :                 bn->tnonil = !nils;
      38          77 :                 bn->tkey = BATcount(bn) <= 1;
      39          77 :                 bn->tsorted = istsorted || BATcount(bn) <= 1;
      40          77 :                 bn->trevsorted = istrevsorted || BATcount(bn) <= 1;
      41          77 :                 *res = bn->batCacheid;
      42          77 :                 BBPkeepref(bn);
      43           1 :         } else if (bn)
      44           1 :                 BBPreclaim(bn);
      45          78 : }
      46             : 
      47             : static void
      48          78 : unfix_inputs(int nargs, ...)
      49             : {
      50          78 :         va_list valist;
      51             : 
      52          78 :         va_start(valist, nargs);
      53         236 :         for (int i = 0; i < nargs; i++) {
      54         158 :                 BAT *b = va_arg(valist, BAT *);
      55         237 :                 BBPreclaim(b);
      56             :         }
      57          78 :         va_end(valist);
      58          78 : }
      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