FAQ
Commit: 6c20b071909d1053c0fc25354675e46bde57e850
Author: Christopher Jones <sixd@php.net> Wed, 19 Mar 2014 15:20:40 -0700
Parents: 8bdf272758b0b126885393bd8eed101cd818d004
Branches: PHP-5.6 master

Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c20b071909d1053c0fc25354675e46bde57e850

Log:
OCI8: fix prototypes for oci_field_*(). They can take a column index or name.

Changed paths:
   M ext/oci8/oci8.c
   M ext/oci8/oci8_interface.c
   M ext/oci8/package.xml
   M ext/oci8/php_oci8.h
   M ext/oci8/tests/reflection1.phpt


Diff:
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 03927e6..74e302c 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -290,7 +290,7 @@ ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_name, 0, 0, 2)
   ZEND_ARG_INFO(0, statement_resource)
- ZEND_ARG_INFO(0, column_number)
+ ZEND_ARG_INFO(0, column_number_or_name)
  ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_size, 0, 0, 2)
@@ -300,22 +300,22 @@ ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_scale, 0, 0, 2)
   ZEND_ARG_INFO(0, statement_resource)
- ZEND_ARG_INFO(0, column_number)
+ ZEND_ARG_INFO(0, column_number_or_name)
  ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_precision, 0, 0, 2)
   ZEND_ARG_INFO(0, statement_resource)
- ZEND_ARG_INFO(0, column_number)
+ ZEND_ARG_INFO(0, column_number_or_name)
  ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_type, 0, 0, 2)
   ZEND_ARG_INFO(0, statement_resource)
- ZEND_ARG_INFO(0, column_number)
+ ZEND_ARG_INFO(0, column_number_or_name)
  ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_type_raw, 0, 0, 2)
   ZEND_ARG_INFO(0, statement_resource)
- ZEND_ARG_INFO(0, column_number)
+ ZEND_ARG_INFO(0, column_number_or_name)
  ZEND_END_ARG_INFO()

  ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_is_null, 0, 0, 2)
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index d6a6232..ca69feb 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -1139,7 +1139,7 @@ PHP_FUNCTION(oci_commit)
  }
  /* }}} */

-/* {{{ proto string oci_field_name(resource stmt, int col)
+/* {{{ proto string oci_field_name(resource stmt, mixed col)
     Tell the name of a column */
  PHP_FUNCTION(oci_field_name)
  {
@@ -1152,7 +1152,7 @@ PHP_FUNCTION(oci_field_name)
  }
  /* }}} */

-/* {{{ proto int oci_field_size(resource stmt, int col)
+/* {{{ proto int oci_field_size(resource stmt, mixed col)
     Tell the maximum data size of a column */
  PHP_FUNCTION(oci_field_size)
  {
@@ -1169,7 +1169,7 @@ PHP_FUNCTION(oci_field_size)
  }
  /* }}} */

-/* {{{ proto int oci_field_scale(resource stmt, int col)
+/* {{{ proto int oci_field_scale(resource stmt, mixed col)
     Tell the scale of a column */
  PHP_FUNCTION(oci_field_scale)
  {
@@ -1182,7 +1182,7 @@ PHP_FUNCTION(oci_field_scale)
  }
  /* }}} */

-/* {{{ proto int oci_field_precision(resource stmt, int col)
+/* {{{ proto int oci_field_precision(resource stmt, mixed col)
     Tell the precision of a column */
  PHP_FUNCTION(oci_field_precision)
  {
@@ -1195,7 +1195,7 @@ PHP_FUNCTION(oci_field_precision)
  }
  /* }}} */

-/* {{{ proto mixed oci_field_type(resource stmt, int col)
+/* {{{ proto mixed oci_field_type(resource stmt, mixed col)
     Tell the data type of a column */
  PHP_FUNCTION(oci_field_type)
  {
@@ -1275,7 +1275,7 @@ PHP_FUNCTION(oci_field_type)
  }
  /* }}} */

-/* {{{ proto int oci_field_type_raw(resource stmt, int col)
+/* {{{ proto int oci_field_type_raw(resource stmt, mixed col)
     Tell the raw oracle data type of a column */
  PHP_FUNCTION(oci_field_type_raw)
  {
@@ -1289,8 +1289,8 @@ PHP_FUNCTION(oci_field_type_raw)
  }
  /* }}} */

-/* {{{ proto bool oci_field_is_null(resource stmt, int col)
- Tell whether a column is NULL */
+/* {{{ proto bool oci_field_is_null(resource stmt, mixed col)
+ Tell whether a field in the current row is NULL */
  PHP_FUNCTION(oci_field_is_null)
  {
   php_oci_out_column *column;
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index c4530bd..e5839f1 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -45,12 +45,12 @@ libraries are available.
    <active>no</active>
   </lead>

- <date>2014-03-11</date>
+ <date>2014-03-19</date>
   <time>12:00:00</time>

    <version>
- <release>2.0.8</release>
- <api>2.0.8</api>
+ <release>2.0.9</release>
+ <api>2.0.9</api>
    </version>
    <stability>
     <release>stable</release>
@@ -58,7 +58,7 @@ libraries are available.
    </stability>
    <license uri="http://www.php.net/license">PHP</license>
    <notes>
-Enhancement - Improve performance of multi-row OCI_RETURN_LOB queries (Bug #66875)
+Fixed oci_field_* reflection: $field can be a column name or index
    </notes>
   <contents>
    <dir name="/">
@@ -463,6 +463,21 @@ Enhancement - Improve performance of multi-row OCI_RETURN_LOB queries (Bug #6687

  <release>
    <version>
+ <release>2.0.8</release>
+ <api>2.0.8</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP</license>
+ <notes>
+Enhancement - Improve performance of multi-row OCI_RETURN_LOB queries (Bug #66875)
+ </notes>
+ </release>
+
+<release>
+ <version>
     <release>2.0.7</release>
     <api>2.0.7</api>
    </version>
diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h
index 5c78faa..066812e 100644
--- a/ext/oci8/php_oci8.h
+++ b/ext/oci8/php_oci8.h
@@ -45,7 +45,7 @@
   */
  #undef PHP_OCI8_VERSION
  #endif
-#define PHP_OCI8_VERSION "2.0.8"
+#define PHP_OCI8_VERSION "2.0.9"

  extern zend_module_entry oci8_module_entry;
  #define phpext_oci8_ptr &oci8_module_entry
diff --git a/ext/oci8/tests/reflection1.phpt b/ext/oci8/tests/reflection1.phpt
index f76d726..2cf3e40 100644
--- a/ext/oci8/tests/reflection1.phpt
+++ b/ext/oci8/tests/reflection1.phpt
@@ -177,7 +177,7 @@ Function [ <internal%s> function oci_field_name ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -193,7 +193,7 @@ Function [ <internal%s> function oci_field_scale ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -201,7 +201,7 @@ Function [ <internal%s> function oci_field_precision ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -209,7 +209,7 @@ Function [ <internal%s> function oci_field_type ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -217,7 +217,7 @@ Function [ <internal%s> function oci_field_type_raw ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -722,7 +722,7 @@ Function [ <internal%s> function ocicolumnname ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -738,7 +738,7 @@ Function [ <internal%s> function ocicolumnscale ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -746,7 +746,7 @@ Function [ <internal%s> function ocicolumnprecision ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -754,7 +754,7 @@ Function [ <internal%s> function ocicolumntype ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

@@ -762,7 +762,7 @@ Function [ <internal%s> function ocicolumntyperaw ] {

    - Parameters [2] {
      Parameter #0 [ <required> $statement_resource ]
- Parameter #1 [ <required> $column_number ]
+ Parameter #1 [ <required> $column_number_or_name ]
    }
  }

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupphp-cvs @
categoriesphp
postedMar 19, '14 at 10:25p
activeMar 19, '14 at 10:25p
posts1
users1
websitephp.net

1 user in discussion

Christopher Jones: 1 post

People

Translate

site design / logo © 2019 Grokbase