1+ --TEST--
2+ Long names: Firebird 4.0 or newer
3+ --SKIPIF--
4+ <?php
5+ require_once ("skipif.inc " );
6+ skip_if_fb_lt (4.0 );
7+ ?>
8+ --FILE--
9+ <?php
10+
11+ require_once ("interbase.inc " );
12+
13+ // FB3: The maximum identifier length is 31 bytes
14+ // FB4: The maximum identifier length is 63 characters character set UTF8 (252 bytes)
15+ $ MAX_LEN = 63 ;
16+
17+ function test_table (string $ table ){
18+ global $ MAX_LEN ;
19+
20+ $ c = 0 ;
21+
22+ $ fields = [
23+ '" ' .str_repeat ("F " , $ MAX_LEN ).'" ' ,
24+ '" ' .str_repeat ("🥰 " , $ MAX_LEN ).'" ' ,
25+ ];
26+ $ fields_str = join (" INTEGER, " , $ fields )." INTEGER " ;
27+ $ create_sql = sprintf ('CREATE TABLE "%s" (%s) ' , $ table , $ fields_str );
28+
29+ if (ibase_query ($ create_sql )){
30+ ibase_commit ();
31+ } else {
32+ var_dump ($ create_sql );
33+ die;
34+ }
35+
36+ $ data = []; foreach ($ fields as $ f )$ data [$ f ] = ++$ c ;
37+ insert_into ($ table , $ data );
38+ print "Table: $ table \n" ;
39+ dump_table_rows ($ table );
40+ }
41+
42+ (function (){
43+ global $ MAX_LEN , $ test_base ;
44+
45+ var_dump ($ MAX_LEN );
46+
47+ test_table (str_repeat ('T ' , $ MAX_LEN ));
48+ test_table (str_repeat ('😂 ' , $ MAX_LEN ));
49+
50+ print $ test_base ;
51+ })();
52+
53+ ?>
54+ --EXPECT--
55+ Table:TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
56+ array(2) {
57+ ["FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"]=>
58+ int(1)
59+ ["🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰"]=>
60+ int(2)
61+ }
62+ Table:😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂
63+ array(2) {
64+ ["FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"]=>
65+ int(1)
66+ ["🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰"]=>
67+ int(2)
68+ }
0 commit comments