<commit_before>CREATE OR REPLACE FUNCTION __temp_mac_pools()
  RETURNS TABLE(cluster_name VARCHAR(40),mac_name VARCHAR(255), mac_desc VARCHAR(4000), mac_dup boolean, mac_default_pool boolean, range text) AS
$PROCEDURE$
BEGIN
    -- In the Engine db 3.6 (or higher), mac_pools has been added
    IF EXISTS (SELECT column_name
               FROM information_schema.columns
               WHERE table_name='mac_pools') THEN
        IF EXISTS (SELECT column_name
                   FROM information_schema.columns
                   WHERE table_name='cluster') THEN
            RETURN QUERY (
            SELECT
                cluster.name AS "Cluster",
                mac_pools.name AS "Name",
                mac_pools.description AS "Description",
                mac_pools.allow_duplicate_mac_addresses AS "Allow Duplicate MAC Address",
                mac_pools.default_pool AS "Default Pool",
                (SELECT string_agg('('||mpr.from_mac||'—'||mpr.to_mac||')', ', ') FROM mac_pool_ranges mpr WHERE mpr.mac_pool_id=mac_pools.id) AS "MAC Pool Ranges"
            FROM
                mac_pools
            -- In recent db, mac_pool_id is not a column in storage_pool
            INNER JOIN cluster ON cluster.mac_pool_id=mac_pools.id ORDER BY cluster.name
            );
        ELSE
            -- Compat mode, engine db < 4
            RETURN QUERY (
            SELECT<commit_msg>inventory: fix query for mac pools<commit_after>CREATE OR REPLACE FUNCTION __temp_mac_pools()
  RETURNS TABLE(cluster_name VARCHAR(40),mac_name VARCHAR(255), mac_desc VARCHAR(4000), mac_dup boolean, mac_default_pool boolean, range text) AS
$PROCEDURE$
BEGIN
    -- In the Engine db 3.6 (or higher), mac_pools has been added
    IF EXISTS (SELECT column_name
               FROM information_schema.columns
               WHERE table_name='mac_pools') THEN
        IF EXISTS (SELECT column_name
                   FROM information_schema.columns
                   WHERE table_name='cluster' AND column_name='mac_pool_id') THEN
            RETURN QUERY (
            SELECT
                cluster.name AS "Cluster",
                mac_pools.name AS "Name",
                mac_pools.description AS "Description",
                mac_pools.allow_duplicate_mac_addresses AS "Allow Duplicate MAC Address",
                mac_pools.default_pool AS "Default Pool",
                (SELECT string_agg('('||mpr.from_mac||'—'||mpr.to_mac||')', ', ') FROM mac_pool_ranges mpr WHERE mpr.mac_pool_id=mac_pools.id) AS "MAC Pool Ranges"
            FROM
                mac_pools
            -- In recent db, mac_pool_id is not a column in storage_pool
            INNER JOIN cluster ON cluster.mac_pool_id=mac_pools.id ORDER BY cluster.name
            );
        ELSE
            -- Compat mode, engine db < 4
            RETURN QUERY (
            SELECT
{'fraction_non_alphanumeric': 0.0753786544557943, 'fraction_numerical': 0.008453680873547023, 'mean_word_length': 2.1004366812227073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '836175', 'n_tokens_mistral': 852, 'n_tokens_neox': 782, 'n_words': 228}