Commit graph

95 commits

Author SHA1 Message Date
Niels Dossche
b9bb8d62ca Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incorrect charset length in check_mb_eucjpms()
2024-03-22 11:32:23 +01:00
Niels Dossche
8ffac997aa Fix incorrect charset length in check_mb_eucjpms()
Closes GH-13781.
2024-03-22 11:31:36 +01:00
Niels Dossche
a8c927005e Skip validity and length calls when the byte cannot be part of a multibyte sequence
Almost every character set can be given a number N such that a multibyte
sequence starts with a byte higher than that number N. This allows us to
skip a lot of work. To ensure the correctness of this, a sanity check is
implemented that exhaustively tries every 4-byte sequence for every
character set and checks for consistency issues.

This finally gives:
  Time (mean ± σ):     120.2 ms ±   1.2 ms    [User: 116.9 ms, System: 2.8 ms]
  Range (min … max):   118.0 ms … 122.9 ms    24 runs
2024-03-07 20:27:18 +01:00
Niels Dossche
1571eed08f Replace dead overflow checks with assertions and avoid indirect call overhead
We allocate twice the input length, and every input character results in
either 1 or 2 output bytes, so we cannot overflow.

By using an enum, and a switch table (which will be efficiently compiled
into a jump table), we can avoid the pessimistic code generation of the
indirect calls.

With this I get the following runtime for the test script in GH-13466 on
my i7-4790, which is around 1.25x faster.
  Time (mean ± σ):     250.9 ms ±   1.6 ms    [User: 248.4 ms, System: 2.0 ms]
  Range (min … max):   248.9 ms … 254.4 ms    11 runs
2024-03-07 20:27:18 +01:00
Pierrick Charron
77ba689fd6
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-10 12:44:39 -04:00
Pierrick Charron
df4dd82ea0
Fix bad integer promotion in mysqlnd big5 charset detection 2022-06-10 12:41:54 -04:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Peter Kokot
bebcdcc745 Remove legacy AC_CHECK_TYPE calls for uint and ulong
The AC_CHECK_TYPE was refactored in more recent versions of Autoconf
and the call with two arguments is obsolete and not recommended anymore.

This patch also refactors some leftovers of using ulong and uint which
are not standard nor common usages of types in C.

The ulong can be used as zend_ulong and uint usage is actually
`unsigned int`.

The usage of HAVE_ULONG removed since it is not used in current code
base.

Legacy edgecase for some legacy HPUX systems removed:
- sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is
  not defined with current build system.

- flags are unsigned int
- max_allowed_packet changed to unsigned int
2019-03-06 22:49:16 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Andrey Hristov
f1ede80781 const-ify some functions 2019-01-04 13:55:34 +02:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Johannes Schlüter
5440b69ef4 Merge branch 'PHP-7.1' 2017-04-14 16:31:19 +02:00
Johannes Schlüter
b760508adc Merge branch 'PHP-7.0' into PHP-7.1 2017-04-14 16:30:51 +02:00
Johannes Schlüter
35a28fac51 Add support for MySQL 8's Unicode types 2017-04-14 16:30:10 +02:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Andrey Hristov
61a6109298 Merge branch 'PHP-7.0' 2016-03-16 10:55:09 +01:00
Andrey Hristov
fa4addd409 More email fixing 2016-03-16 10:54:56 +01:00
Andrey Hristov
3a33ee63e8 Merge branch 'PHP-7.0' 2016-03-16 10:47:27 +01:00
Andrey Hristov
f2ab731a8c Fix emails in headers. @mysql.com addresses are no more since many years. 2016-03-16 10:24:52 +01:00
Lior Kaplan
3d5438bf7b Merge branch 'PHP-7.0'
* PHP-7.0:
  Update header to PHP Version 7
  Happy new year (Update copyright to 2016)
  Happy new year (Update copyright to 2016)
2016-01-01 20:04:31 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Andrey Hristov
2e3fc57c5c MNDR:
- move things out of mysqlnd_priv.h
2015-11-12 16:19:16 +01:00
Andrey Hristov
e8ace2d4db MNDR:
- remove inclusion of uneeded headers
2015-11-12 16:19:16 +01:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
bdbf47df18 ported mysql and mysqlnd 2014-08-19 16:51:06 +02:00
Andrey Hristov
a886a0cf93 Add support for gb18030/MySQL 5.7 2014-06-18 21:53:34 +03:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Nikita Popov
585f71f497 Fix some errors in mysqlnd charset list
I fixed the stuff that seemed obviously wrong, but there are some more
differences with the SHOW COLLATIONS output:

 * The whole range of "utf16" collations missing
 * "filename" missing
 * "ucs2_general_mysql500_ci" and "utf8_general_mysql500_ci" missing

I wasn't sure whether those omissions are intentional, so I didn't add
them.
2013-03-24 16:09:39 +01:00
Andrey Hristov
f45a85c386 add new charset, from MySQL 5.6 2013-02-01 17:21:50 +01:00
Xinchen Hui
c2f8e90504 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-06 10:20:00 +08:00
Xinchen Hui
bc11e6fdbb bump year 2013-01-06 10:19:09 +08:00
andrey
08f4b3c3ac Merge branch 'PHP-5.3' into PHP-5.4 2012-06-29 12:43:14 +03:00
andrey
f826ea093f new charsets 2012-06-29 12:42:54 +03:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Rui Hirokawa
41ddca803d fixed maximum byte length of utf8mb4. 2011-10-18 14:28:21 +00:00
Gustavo André dos Santos Lopes
dbe8c7c4fa - Fixed bad xor in signed types due to integer promotion.
- Replaced undefined signed overflow with char -> unsigned char conversion.
2011-09-05 00:39:39 +00:00