PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/mysqli - mysqli_report.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 13 15 86.7 %
Date: 2014-11-10 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 7                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 1997-2014 The PHP Group                                |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Author: Georg Richter <georg@php.net>                                |
      16             :   +----------------------------------------------------------------------+
      17             : 
      18             :   $Id$
      19             : */
      20             : 
      21             : #ifdef HAVE_CONFIG_H
      22             : #include "config.h"
      23             : #endif
      24             : 
      25             : #include "php.h"
      26             : #include "php_ini.h"
      27             : #include "ext/standard/info.h"
      28             : #include "php_mysqli_structs.h"
      29             : 
      30             : extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
      31             : 
      32             : /* {{{ proto bool mysqli_report(int flags)
      33             :    sets report level */
      34          33 : PHP_FUNCTION(mysqli_report)
      35             : {
      36             :         zend_long flags;
      37             : 
      38             : 
      39          33 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
      40           2 :                 return;
      41             :         }
      42             : 
      43          31 :         MyG(report_mode) = flags;
      44             : 
      45          31 :         RETURN_TRUE;
      46             : }
      47             : /* }}} */
      48             : 
      49             : /* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
      50          13 : void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC)
      51             : {
      52          13 :         php_mysqli_throw_sql_exception((char *)sqlstate, errorno TSRMLS_CC, "%s", error);
      53          13 : }
      54             : /* }}} */
      55             : 
      56             : /* {{{ void php_mysqli_report_index() */
      57           2 : void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
      58             :         char index[15];
      59             : 
      60           2 :         if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) {
      61           0 :                 strcpy(index, "Bad index");
      62           2 :         } else if (status & SERVER_QUERY_NO_INDEX_USED) {
      63           2 :                 strcpy(index, "No index");
      64             :         } else {
      65           0 :                 return;
      66             :         }
      67           2 :         php_mysqli_throw_sql_exception("00000", 0 TSRMLS_CC, "%s used in query/prepared statement %s", index, query);
      68             : }
      69             : /* }}} */
      70             : 
      71             : /*
      72             :  * Local variables:
      73             :  * tab-width: 4
      74             :  * c-basic-offset: 4
      75             :  * End:
      76             :  * vim600: noet sw=4 ts=4 fdm=marker
      77             :  * vim<600: noet sw=4 ts=4
      78             :  */

Generated by: LCOV version 1.10

Generated at Mon, 10 Nov 2014 22:46:42 +0000 (11 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.