php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36324 php does not return data consistently
Submitted: 2006-02-07 21:02 UTC Modified: 2007-07-31 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lec at uchicago dot edu Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5CVS-2006-02-08 OS: Mac OS X
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lec at uchicago dot edu
New email:
PHP Version: OS:

 

 [2006-02-07 21:02 UTC] lec at uchicago dot edu
Description:
------------
Here is the problem, I was able to narrow the problem down to PHP ODBC, but I am still not sure why. Specifically ODBC_exec not returning data properly, but only in the case  where there is text field or combination of text and number, etc as bellow. It works with number, date, time, timestamp alone, not text alone. The data will eventaully be returned but only last 32 records from any # of records, and it takes for ever. I mean sometimes with doing simple select on few thousand records is taking 5-10 mins. 


run: 
/opt/php5.1.2/bin/php test.php

You will need:
Mac OS X
PHP 5.1.2
Apache 2.2.0 (well command line is a problem as well, so no need for apache)
iODBC 3.52.4

Oh yea on db side of things Mac OS X filemaker server w/odbc drivers. I am willing to provide dev server access and/or test it.  

Reproduce code:
---------------
<?php

putenv("DYLD_LIBRARY_PATH=/opt/libiodbc-3.52.4/lib");
putenv("ODBCINSTINI=/Library/ODBC/odbcinst.ini");
putenv("ODBCINI=/Library/ODBC/odbc.ini");

//$qry = "SELECT test FROM Person";  // test filed has text

// I limited this so it is readable
$qry = "SELECT PersonID, test FROM Person where PersonID>1 AND PersonID<100";
print $qry;

$conn = odbc_connect("Person", "username", "password");

$queryresult=odbc_exec($conn,$qry);
odbc_result_all($queryresult,1);
odbc_close($conn);

?>

Expected result:
----------------
SELECT PersonID, test FROM Person where PersonID>1 AND PersonID<100SQLNumResultCols
SQLNumResultCols
<table 1 ><tr><th>PersonID</th><th>test</th></tr>
<tr><td>1</td><td>hello</td></tr>
//... I did not want to copy all the data in here, but basically it just gets id's and text. 
<tr><td>67</td><td>hello</td></tr>
<tr><td>68</td><td>hello</td></tr>
<tr><td>69</td><td>hello</td></tr>
<tr><td>70</td><td>hello</td></tr>
<tr><td>71</td><td>hello</td></tr>
<tr><td>72</td><td>hello</td></tr>
<tr><td>73</td><td>hello</td></tr>
<tr><td>74</td><td>hello</td></tr>
<tr><td>75</td><td>hello</td></tr>
<tr><td>76</td><td>hello</td></tr>
<tr><td>77</td><td>hello</td></tr>
<tr><td>78</td><td>hello</td></tr>
<tr><td>79</td><td>hello</td></tr>
<tr><td>80</td><td>hello</td></tr>
<tr><td>81</td><td>hello</td></tr>
<tr><td>82</td><td>hello</td></tr>
<tr><td>83</td><td>hello</td></tr>
<tr><td>84</td><td>hello</td></tr>
<tr><td>85</td><td>hello</td></tr>
<tr><td>86</td><td>hello</td></tr>
<tr><td>87</td><td>hello</td></tr>
<tr><td>88</td><td>hello</td></tr>
<tr><td>89</td><td>hello</td></tr>
<tr><td>90</td><td>hello</td></tr>
<tr><td>91</td><td>hello</td></tr>
<tr><td>92</td><td>hello</td></tr>
<tr><td>93</td><td>hello</td></tr>
<tr><td>94</td><td>hello</td></tr>
<tr><td>95</td><td>hello</td></tr>
<tr><td>96</td><td>hello</td></tr>
<tr><td>97</td><td>hello</td></tr>
<tr><td>98</td><td>hello</td></tr>
<tr><td>99</td><td>hello</td></tr>
</table>

Actual result:
--------------
Notice the number and text do not work either, number alone does work. 


SELECT PersonID, test FROM Person where PersonID>1 AND PersonID<100SQLNumResultCols
SQLNumResultCols
<table 1 ><tr><th>PersonID</th><th>test</th></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>0</td><td></td></tr>
<tr><td>67</td><td>hello</td></tr>
<tr><td>68</td><td>hello</td></tr>
<tr><td>69</td><td>hello</td></tr>
<tr><td>70</td><td>hello</td></tr>
<tr><td>71</td><td>hello</td></tr>
<tr><td>72</td><td>hello</td></tr>
<tr><td>73</td><td>hello</td></tr>
<tr><td>74</td><td>hello</td></tr>
<tr><td>75</td><td>hello</td></tr>
<tr><td>76</td><td>hello</td></tr>
<tr><td>77</td><td>hello</td></tr>
<tr><td>78</td><td>hello</td></tr>
<tr><td>79</td><td>hello</td></tr>
<tr><td>80</td><td>hello</td></tr>
<tr><td>81</td><td>hello</td></tr>
<tr><td>82</td><td>hello</td></tr>
<tr><td>83</td><td>hello</td></tr>
<tr><td>84</td><td>hello</td></tr>
<tr><td>85</td><td>hello</td></tr>
<tr><td>86</td><td>hello</td></tr>
<tr><td>87</td><td>hello</td></tr>
<tr><td>88</td><td>hello</td></tr>
<tr><td>89</td><td>hello</td></tr>
<tr><td>90</td><td>hello</td></tr>
<tr><td>91</td><td>hello</td></tr>
<tr><td>92</td><td>hello</td></tr>
<tr><td>93</td><td>hello</td></tr>
<tr><td>94</td><td>hello</td></tr>
<tr><td>95</td><td>hello</td></tr>
<tr><td>96</td><td>hello</td></tr>
<tr><td>97</td><td>hello</td></tr>
<tr><td>98</td><td>hello</td></tr>
<tr><td>99</td><td>hello</td></tr>
</table>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-08 00:47 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-02-08 02:15 UTC] lec at uchicago dot edu
One quick note:

I have come to belive this is some kind of buffer problem. I see that some data comes through when i do netstat -atn | grep 2399 (odbc port). It is infreequent, and in very small chunks. I think the text fields in fm db are quite large, perhaps blobs. 

Lec
 [2007-07-23 12:07 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

And try the PDO ODBC driver instead.
 [2007-07-31 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC