Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
mssql_base
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 7
56
0.00% covered (danger)
0.00%
0 / 1
 sql_concatenate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 sql_escape
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 sql_lower_text
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 _sql_like_expression
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 _sql_not_like_expression
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 cast_expr_to_bigint
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 sql_quote
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\db\driver;
15
16/**
17* MSSQL Database Base Abstraction Layer
18 */
19abstract class mssql_base extends \phpbb\db\driver\driver
20{
21    /**
22    * {@inheritDoc}
23    */
24    public function sql_concatenate($expr1, $expr2)
25    {
26        return $expr1 . ' + ' . $expr2;
27    }
28
29    /**
30    * {@inheritDoc}
31    */
32    function sql_escape($msg)
33    {
34        return str_replace(array("'", "\0"), array("''", ''), $msg);
35    }
36
37    /**
38    * {@inheritDoc}
39    */
40    function sql_lower_text($column_name)
41    {
42        return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
43    }
44
45    /**
46    * {@inheritDoc}
47    */
48    protected function _sql_like_expression(string $expression): string
49    {
50        return $expression . " ESCAPE '\\'";
51    }
52
53    /**
54    * {@inheritDoc}
55    */
56    protected function _sql_not_like_expression(string $expression): string
57    {
58        return $expression . " ESCAPE '\\'";
59    }
60
61    /**
62    * {@inheritDoc}
63    */
64    function cast_expr_to_bigint($expression)
65    {
66        return 'CONVERT(BIGINT, ' . $expression . ')';
67    }
68
69    /**
70    * {@inheritDoc}
71    */
72    function sql_quote($msg)
73    {
74        return '"' . $msg . '"';
75    }
76}