Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130586 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id F07D81A00BC for ; Tue, 7 Apr 2026 15:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775574027; bh=DR9+NvRf+vTMk36mgtnFLihSAaVEx0Q3WdSPAFTvYzo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QZgVA4dafj/dIJXrO5Agw92OfQZsaDWDlKM3Y43MvQwrOvj7mIqLAEv5K9QzKA/cB mM/o1eqUHqY+onUPbZl69ozLQcADHUITzyJ/nnnC69bXsgJzzo2KSIRvWegjGZNXoJ mi/+JzIC6H5PiuiaBMN2q4vubYoW694Fmxi82mtW2AACvO+kAu5oY2D0cbF7S7trcS +TEPaKso8g4Xn2jbNl+4Vn6cFeneJ5XQN5JNmWEVW8QZtE1pnbl6SFt3iOUC5JsN2m 2YIiD35kXAvPfspGmcUMX0dLkbG9wVtFhFj7I7Ya0vcIIBN1U3CkJp1WFiR+gcGweF tV5DXSV2NRcYw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 95697180050 for ; Tue, 7 Apr 2026 15:00:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FORGED_GMAIL_RCVD,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 7 Apr 2026 15:00:26 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-38dd5f28a4cso29730521fa.2 for ; Tue, 07 Apr 2026 08:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775574020; cv=none; d=google.com; s=arc-20240605; b=ZP79bfwtzpNx8TOj5QP09xqNxHEQBHYS4D4AyWNSZmUz+fpvQ8kpNA5F1sCATFLCjQ Vhb0XjC1aGqX2hib1U9f5QEztFw01wB4eSAIUiPAW+GubtrPELvLY55XqE4jdalhA82J cz6Fy4mvAX6F4K82ZfEL6Zi6OlKdGNmtOyNnAwscMIP+qoA5qLCOWgs4iva2zC7s/Vt3 INTeX89LEqTioDMfYJtN1WAhWQ9QmfNrduUNySxGORpZfUCXh/pvdX0qkBsbe05agVJt WL8qgMeiECRsgOWIyBrUnSInWUqJbokpgzj6pVsA1lvWXaFibAK6GLpbnq/NZwrUDUhC SM1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DR9+NvRf+vTMk36mgtnFLihSAaVEx0Q3WdSPAFTvYzo=; fh=i0ty0nTZBZ876jrL0ulcbpzh56M4s/EC273hDGooEaM=; b=YLyT5Q85IHk/98S4TjOkb12o0XB09DYuDFJluoTts8brt9NP2vrpRGAYXhHnZ0tDH6 R1NELnpsCmBCX73CL3xAoaJlcz6XfbYjZHY5BcDZMcaoGlZKkCvOK38VrTT7HuEoa7WW NGJciLxeW4GHWKSy6pAK2spyimH/JmmxFGb/fYsRiyjYGq/yDlsEzwS/fxJXNn44gJOP bHdqLTr1d67rLAnwqNuFQAzHbf6LY/ip0FkAnuYZWihFw8uyWW/WX56aMZ04JImBxswG LmvqkaLbBk3mHot6vl/jWMaEjEVY2Y+mba3rcZ4qSLpCFEO9rAja2x3yaZDazvx7UHNb 4Chg==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775574020; x=1776178820; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DR9+NvRf+vTMk36mgtnFLihSAaVEx0Q3WdSPAFTvYzo=; b=W9uQ+Iowyx3a00FbNo1ciz+uYkktTSHKSzEC642FocNE0wcjPn1iPScZM+CTAdBaAu tsWMfjHftV3L11vFBZtQmVEH+IDPtMA57KE6PXBRlC2I24dofmEf7WibEhPHnGTnRbz+ JeAumhIXteU2MvVDKYb435dedHp4jeQYtprNIRFxmAz305b3a+D8HfAHcaFDwE0Q4D6a ReiT+Yx1J8uq+4AgO2R8KiZLH0EPgqRS19+3eV74guG0sLGXAoCNvVqeRsluosfIieb4 N1Z6HJgfxi9X5DlG6JWfJAo+cT6RadBc3S6FycqwnsqIz26TDXE46cp8sXxq6VpWGPJU h19A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775574020; x=1776178820; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DR9+NvRf+vTMk36mgtnFLihSAaVEx0Q3WdSPAFTvYzo=; b=TaW7FA4AvSMv8Yg1IkE8595kdQOd353ewCb3OeEO42/OeDc5IBujV0MYjT3dnbP1ol EhttFh5AdZWILyWLj76PnV939Dq46U9iVmhbq1d1X2HpLzGBa3Lo9VTLMa0DypGDmTOk svipuyq6rdEg8BImRM7tzOKO6Swbo3/O/d8IgXj0DHW8FM8VdXeCo4kffRxSyD4UYgob YkfElTB+F1DghsVrJzItTmP76wx7cW43dwkNIhKNu2V7Shgmw0SQDB9H0sTmQEBtoLhE Z1daOahWav3h85Fr1X4MmUoUqCFsSGvcja1dMHA/EXmWMFJN7yKegnh3rf2L7eD34czN PHkQ== X-Gm-Message-State: AOJu0Ywx8BguKc0TS0JRWJgb6G6cXE75kt7CB5kVZwK9UZ11+4lovEuB aCbNoZlDcEsjQijrusHR6W8/tPTaeYBAo4lNF0RzRJQSdfOfkvcShyK/vPfI+3Bqwo3gWxxLx8O Ty91dqlpAR4Ndr729FO6Cib79VC13xQM= X-Gm-Gg: AeBDieuyEqeQaxGzkr4aUwHmHhkI88gDqOiXnviWfcO7JQQROR5mTvEx2leVpw4PBZx WAKjx5hZeNjXbBnZB5qIPRpe8nWYWqjWiqcyfRSmo58/nYp8vqMDQq9kd+JWQlg6PKYhbRVOgaz K2h2BHUpyAt7sfSGoHN6o+dJrTNL7MJVlDqqi6hThMv4YfBr5G0b0aYyofEqOo4E3RBUAuDz2rY QzEDLQBRIzsLVhghNaEkfpWAEAhKjitQjHaHAml+o31jK8JAxJaZm4J4KmAexWKlItzRa8DtVuk s8cWy+U= X-Received: by 2002:a2e:be8c:0:b0:38b:f454:8569 with SMTP id 38308e7fff4ca-38d8d1dc4d4mr54761441fa.0.1775574019086; Tue, 07 Apr 2026 08:00:19 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 7 Apr 2026 16:00:06 +0100 X-Gm-Features: AQROBzCWSOOg4Qbd-2XvmT8mYW8LDxgQ0AS_1el0fPGFA0F54NTkZxoGqYTS6o4 Message-ID: Subject: Re: [PHP-DEV] [RFC][Discussion] Add MariaDB-specific features to mysqlnd and mysqli To: Georg Richter Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tekiela246@gmail.com (Kamil Tekiela) On Tue, 7 Apr 2026 at 12:02, Georg Richter wrote: > > Hi, > > I would like to start a discussion on a new RFC: "Add MariaDB-specific fe= atures to mysqlnd and mysqli." > > RFC: > https://wiki.php.net/rfc/mariadb_rfc > > A proof of concept is available on my forked github-repository: > https://github.com/9EOR9/php-src/tree/8.6-mariadb > > Benchmarks and results: > https://github.com/9EOR9/php-mariadb-rfc > > /Georg > > -- > Georg Richter, Staff Software Engineer > Client Connectivity > MariaDB Corporation Ab Hi Georg, Thank you for presenting this RFC. I have a lot of comments: First of all, regardless of what I am going to say next, I believe all of these features should be treated in isolation and implemented in separate PRs. It makes PR reviewing and git blaming easier, but also performance changes can be tested in isolation. ---------------------------- Authentication Plugins: You mention only one new plugin: parsec. Adding authentication plugins does not require RFC. You can submit a separate PR without the RFC process. Even if MySQL doesn't support the new method, adding a new plugin isn't going to break anything. ---------------------------- Extended Metadata: It looks like you have some formatting issues there. I don't understand what this feature is, how to use it, nor how it will be exposed. It needs more explanation. In the table, you mention that it doesn't require any user-facing changes, but it does. The returned structure is extended with two new fields from what I can see. Additionally, the PoC changes existing field values too. ---------------------------- Prepared Statement Metadata Caching: In theory I am all for adding transparent improvements and they don't usually require an RFC, but in this case, I don't understand how the caching will be done. Are you saying the user will need to cache the metadata somewhere? Is the cache shared across requests? How will the cache be invalidated/cleaned? From the implementation, it seems like the cache is only per prepared statement, i.e. only the first execute() call will fetch the metadata. If that's all it is then it can be made into a simple PR without RFC. But in the table you say "Avoids resending metadata for repeated prepares" which confuses me. You also said: > Performance Improvements: Existing PHP functions that prepare and execute= statements, such as mysql_execute_query() (introduced in PHP 8.2), could b= e updated to use execute_direct when connected to a MariaDB server. This wo= uld allow one-time statements to bypass the extra round-trip and metadata f= etch, providing immediate performance gains. Does this refer to caching? How does caching improve the performance of a one-time executed prepared statement? If that's not what it refers to, then what did you mean? ---------------------------- Progress Indication: I'm quite worried about this one. PHP doesn't have native asynchronous support yet. How do you intend for this to work when a built-in PHP function can be suspended and possibly interrupted completely while the MySQL is processing the request? ---------------------------- PDO Considerations: Why is PDO out of scope? PDO is the main database extension in PHP. If any new feature is added, then it should probably be exposed via PDO first. What do you mean by "PDO_MySQL currently does not support array binding or bulk execution semantics"? ---------------------------- Server capabilities: I don't think it's more robust to detect MariaDB server by the lack of CLIENT_LONG_PASSWORD than it is by the server_version. What if MySQL decides to remove that flag in the future? What if derived products don't follow the same convention? Why is it necessary to expose this information to the PHP user via server_capabilities and ext_server_capabilities? I can't find anywhere that you explain what information is presented in these properties or how to use it. ---------------------------- Memory Consumption: Why is using generators going to use less memory? How does the new function use generators that it's able to provide performance improvements without reading all of the data from the generator beforehand? This needs to be clearly explained so that it can be explained in the PHP manual later. What is the difference between these two: ``` $stmt->executemany("sd", $generator); $stmt->executemany("sd", iterator_to_array($generator)); ``` ---------------------------- mysqli_stmt::executemany implementation: You only mention the OO-style method in the RFC. Will the procedural style counterpart also be implemented? The name doesn't follow mysqli naming standard. It should be called mysqli_stmt::execute_many. However, I wonder what made you land on this name instead of mysqli_stmt::bulk_execute? There should be no $types parameter IMHO. The data should either always be treated as text, or it should be bound using the PHP type, i.e. autodetected. I believe it was a mistake that bind_param() has a $types parameter. All it serves is to cast the data silently into the specified type. It has been a source of many silent bugs and a lot of confusion. Additionally, giving users more type choices in executemany() will not only create an inconsistency with bind_param(), but also confuse PHP users who don't know if a variable is 8, or 16, or 32, or 64-bit. > Return Values: Returns true on success or false on failure. Please be explicit what the failure conditions may be. How does get_result() work with executemany()? For example, if I execute SELECT ?,? with [[1,2], [3,4]] will I get that same structure in the result set? Is the sequence guaranteed? Is there a way to distinguish which row came from which input data row? What if one SELECT produces two rows and the other zero? Will it still be a single mysqli_result? How does it work with store_result() and also with unbuffered result sets? I assume it's all treated the same as a normal execute(), correct? How does this affect insert_id? MariaDB documentation says that only "the first auto-generated ID" is returned, which is contrary to what I expect: the last. Does the value propagate to PHP? If so, why? From what I can see, it is possible to request that MariaDB reply with individual result sets. Wouldn't that be better? How would that impact the performance? How about atomicity? If I make 3 INSERTS and the middle one fails, will the other two execute? Indicator enum should contain only two values: IGNORE and DEFAULT. Null is already a PHP data type and does not require an indicator. None serves no purpose (what would even happen if someone used it). Adding an Indicator enum will create an inconsistency with the existing feature set which do not support it. An enum should be defined by the extension in which it will be used, i.e. mysqli. The mysqlnd extension shuld not expose any user-facing APIs. When connected to the MySQL server, how will executemany() behave? I assume there will be an emulated support for it in mysqlnd, but how will you ensure consistency between these two implementations? Making the function no-op with MySQL should be out of the question. Regards, Kamil Tekiela